!34 回合chkconfig上游社区补丁解耦对cgroup的依赖
From: @dongyuzhen Reviewed-by: @xujing99 Signed-off-by: @xujing99
This commit is contained in:
commit
0aebecc0ac
44
backport-leveldb-fix-systemdActive.patch
Normal file
44
backport-leveldb-fix-systemdActive.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
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
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: chkconfig
|
Name: chkconfig
|
||||||
Version: 1.14
|
Version: 1.14
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: chkconfig updates and queries runlevel information for system services
|
Summary: chkconfig updates and queries runlevel information for system services
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: https://github.com/fedora-sysv/chkconfig
|
URL: https://github.com/fedora-sysv/chkconfig
|
||||||
@ -11,7 +11,9 @@ Conflicts: initscripts <= 5.30-1
|
|||||||
Provides: ntsysv = %{version}-%{release}
|
Provides: ntsysv = %{version}-%{release}
|
||||||
Obsoletes: ntsysv < %{version}-%{release}
|
Obsoletes: ntsysv < %{version}-%{release}
|
||||||
|
|
||||||
Patch0: fix-coredump-while-parseServiceInfo-return-1.patch
|
Patch0: fix-coredump-while-parseServiceInfo-return-1.patch
|
||||||
|
|
||||||
|
Patch6000: backport-leveldb-fix-systemdActive.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
chkconfig provides a simple command-line tool for maintaining
|
chkconfig provides a simple command-line tool for maintaining
|
||||||
@ -59,6 +61,9 @@ mkdir -p %{buildroot}%{_sysconfdir}/chkconfig.d
|
|||||||
%{_mandir}/man8/*
|
%{_mandir}/man8/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Aug 22 2024 dongyuzhen <dongyuzhen@h-partners.com> - 1.14-4
|
||||||
|
- fix systemdActive()
|
||||||
|
|
||||||
* Mon Feb 13 2023 xujing <xujing125@huawei.com> - 1.14-3
|
* Mon Feb 13 2023 xujing <xujing125@huawei.com> - 1.14-3
|
||||||
- enable make check
|
- enable make check
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user