diff --git a/backport-leveldb-fix-systemdActive.patch b/backport-leveldb-fix-systemdActive.patch new file mode 100644 index 0000000000000000000000000000000000000000..44c463939e5680b785148c0a782219e3b7bd17a9 --- /dev/null +++ b/backport-leveldb-fix-systemdActive.patch @@ -0,0 +1,44 @@ +From 5b5268cc2d7fec04365996026f64992db6c45aa9 Mon Sep 17 00:00:00 2001 +From: Marcos Mello +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 + diff --git a/chkconfig.spec b/chkconfig.spec index 0007ede61b92a22bbbc48959bf7fe3ae72c448b3..5d9c4a5e2b7f0d9aae7929a3011f77994f38b654 100644 --- a/chkconfig.spec +++ b/chkconfig.spec @@ -1,7 +1,7 @@ Summary: A system tool for maintaining the /etc/rc*.d hierarchy Name: chkconfig Version: 1.25 -Release: 1 +Release: 2 License: GPL-2.0-only URL: https://github.com/fedora-sysv/chkconfig Source: https://github.com/fedora-sysv/chkconfig/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -11,7 +11,9 @@ Provides: ntsysv = %{version}-%{release} Obsoletes: ntsysv < %{version}-%{release} Provides: /sbin/chkconfig -Patch0: fix-coredump-while-parseServiceInfo-return-1.patch +Patch0: fix-coredump-while-parseServiceInfo-return-1.patch + +Patch6000: backport-leveldb-fix-systemdActive.patch %description Chkconfig is a basic system utility. It updates and queries runlevel @@ -57,6 +59,9 @@ mkdir -p $RPM_BUILD_ROOT/etc/chkconfig.d %{_mandir}/man8/* %changelog +* Mon Aug 12 2024 fuanan - 1.25-2 +- fix systemdActive() + * Fri Aug 4 2023 dillon chen - 1.25-1 - update version to 1.25