chkconfig/backport-leveldb-fix-systemdActive.patch

45 lines
1.1 KiB
Diff
Raw Normal View History

2024-08-12 10:56:41 +08:00
From 5b5268cc2d7fec04365996026f64992db6c45aa9 Mon Sep 17 00:00:00 2001
From: Marcos Mello <marcosfrm@gmail.com>
Date: Sun, 15 Oct 2023 14:35:06 -0300
Subject: [PATCH] leveldb: fix systemdActive()
/sys/fs/cgroup/systemd is long gone:
https://systemd.io/CGROUP_DELEGATION/
Check for /run/systemd/system/ directory existence instead:
https://www.freedesktop.org/software/systemd/man/sd_booted.html
Closes fedora-sysv/chkconfig#116
Reference:https://github.com/fedora-sysv/chkconfig/commit/5b5268cc2d7fec04365996026f64992db6c45aa9
Conflict:NA
---
leveldb.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/leveldb.c b/leveldb.c
index 7b8c1bd..564a207 100644
--- a/leveldb.c
+++ b/leveldb.c
@@ -946,13 +946,7 @@ int systemdIsInit() {
}
int systemdActive() {
- struct stat a, b;
-
- if (lstat("/sys/fs/cgroup", &a) < 0)
- return 0;
- if (lstat("/sys/fs/cgroup/systemd", &b) < 0)
- return 0;
- if (a.st_dev == b.st_dev)
+ if (access("/run/systemd/system/", F_OK) < 0)
return 0;
if (!systemdIsInit())
return 0;
--
2.33.0