Compare commits
10 Commits
a942ee7b53
...
82dd7f5125
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82dd7f5125 | ||
|
|
4b54d308b2 | ||
|
|
45bc4c962d | ||
|
|
7d8c02b1a2 | ||
|
|
3a13014f73 | ||
|
|
d45ae30676 | ||
|
|
cc8cb555a0 | ||
|
|
c6c5e47679 | ||
|
|
43a32a8aff | ||
|
|
1252a3bb9d |
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
|
||||||
|
|
||||||
Binary file not shown.
BIN
chkconfig-1.21.tar.gz
Normal file
BIN
chkconfig-1.21.tar.gz
Normal file
Binary file not shown.
@ -1,21 +1,25 @@
|
|||||||
|
Summary: A system tool for maintaining the /etc/rc*.d hierarchy
|
||||||
Name: chkconfig
|
Name: chkconfig
|
||||||
Version: 1.14
|
Version: 1.21
|
||||||
Release: 2
|
Release: 2
|
||||||
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
|
||||||
Source0: https://github.com/fedora-sysv/chkconfig/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source: https://github.com/fedora-sysv/chkconfig/archive/refs/tags/%{name}-%{version}.tar.gz
|
||||||
|
BuildRequires: newt-devel gettext popt-devel libselinux-devel beakerlib gcc systemd-devel make
|
||||||
BuildRequires: gcc newt-devel gettext popt-devel libselinux-devel beakerlib
|
|
||||||
Conflicts: initscripts <= 5.30-1
|
Conflicts: initscripts <= 5.30-1
|
||||||
Provides: ntsysv = %{version}-%{release}
|
Provides: ntsysv = %{version}-%{release}
|
||||||
Obsoletes: ntsysv < %{version}-%{release}
|
Obsoletes: ntsysv < %{version}-%{release}
|
||||||
|
Provides: /sbin/chkconfig
|
||||||
|
|
||||||
|
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 is a basic system utility. It updates and queries runlevel
|
||||||
the /etc/rc[0-6].d directory hierarchy by relieving system
|
information for system services. Chkconfig manipulates the numerous
|
||||||
administrators of the task of directly manipulating the numerous
|
symbolic links in /etc/rc.d, to relieve system administrators of some
|
||||||
symbolic links in those directories.
|
of the drudgery of manually editing the symbolic links.
|
||||||
|
|
||||||
%package_help
|
%package_help
|
||||||
|
|
||||||
@ -31,15 +35,13 @@ make check
|
|||||||
%install
|
%install
|
||||||
%make_install MANDIR=%{_mandir} SBINDIR=%{_sbindir}
|
%make_install MANDIR=%{_mandir} SBINDIR=%{_sbindir}
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
|
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
|
||||||
for i in {0..6};do
|
ln -s rc.d/init.d $RPM_BUILD_ROOT/etc/init.d
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc${i}.d
|
for n in 0 1 2 3 4 5 6; do
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc${n}.d
|
||||||
|
ln -s rc.d/rc${n}.d $RPM_BUILD_ROOT/etc/rc${n}.d
|
||||||
done
|
done
|
||||||
ln -s rc.d/init.d %{buildroot}%{_sysconfdir}/init.d
|
mkdir -p $RPM_BUILD_ROOT/etc/chkconfig.d
|
||||||
for i in {0..6};do
|
|
||||||
ln -s rc.d/rc${i}.d %{buildroot}%{_sysconfdir}/rc${i}.d
|
|
||||||
done
|
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/chkconfig.d
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%dir %{_sysconfdir}/alternatives
|
%dir %{_sysconfdir}/alternatives
|
||||||
@ -48,7 +50,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/chkconfig.d
|
|||||||
%{_sysconfdir}/rc.d/{inid.d,rc[0-6].d}
|
%{_sysconfdir}/rc.d/{inid.d,rc[0-6].d}
|
||||||
%{_sysconfdir}/chkconfig.d
|
%{_sysconfdir}/chkconfig.d
|
||||||
%{_sbindir}/{*alternatives,ntsysv}
|
%{_sbindir}/{*alternatives,ntsysv}
|
||||||
/sbin/chkconfig
|
%{_sbindir}/chkconfig
|
||||||
%{_prefix}/lib/systemd/systemd-sysv-install
|
%{_prefix}/lib/systemd/systemd-sysv-install
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%{_datadir}/locale/*/LC_MESSAGES/chkconfig.mo
|
%{_datadir}/locale/*/LC_MESSAGES/chkconfig.mo
|
||||||
@ -57,6 +59,21 @@ mkdir -p %{buildroot}%{_sysconfdir}/chkconfig.d
|
|||||||
%{_mandir}/man8/*
|
%{_mandir}/man8/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 12 2024 fuanan <fuanan3@h-partners.com> - 1.21-2
|
||||||
|
- fix systemdActive()
|
||||||
|
|
||||||
|
* Wed Oct 12 2022 fushanqing <fushanqing@kylinos.cn> - 1.21-1
|
||||||
|
- Update to 1.21
|
||||||
|
|
||||||
|
* Sat Aug 27 2022 yixiangzhike <yixiangzhike007@163.com> - 1.20-2
|
||||||
|
- fix coredump while parseServiceInfo return non-zero
|
||||||
|
|
||||||
|
* Sat Nov 27 2021 wangchen <wangchen137@huawei.com> - 1.20-1
|
||||||
|
- Update to 1.20
|
||||||
|
|
||||||
|
* Thu Jul 8 2021 duyiwei <duyiwei@kylinos.cn> - 1.15-1
|
||||||
|
- Update to 1.15
|
||||||
|
|
||||||
* Mon Aug 31 2020 wangchen <wangchen137@huawei.com> - 1.14-2
|
* Mon Aug 31 2020 wangchen <wangchen137@huawei.com> - 1.14-2
|
||||||
- Open make check because beakerlib exist
|
- Open make check because beakerlib exist
|
||||||
|
|
||||||
@ -68,3 +85,4 @@ mkdir -p %{buildroot}%{_sysconfdir}/chkconfig.d
|
|||||||
|
|
||||||
* Fri Aug 30 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.10-7
|
* Fri Aug 30 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.10-7
|
||||||
- Package Init
|
- Package Init
|
||||||
|
|
||||||
|
|||||||
25
fix-coredump-while-parseServiceInfo-return-1.patch
Normal file
25
fix-coredump-while-parseServiceInfo-return-1.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 05f7ea8fa198a6b98dd98cb1a8b1774da701e917 Mon Sep 17 00:00:00 2001
|
||||||
|
From: xujing <xujing125@huawei.com>
|
||||||
|
Date: Fri, 12 Aug 2022 10:01:32 +0800
|
||||||
|
Subject: [PATCH] fix coredump while parseServiceInfo return 1
|
||||||
|
|
||||||
|
---
|
||||||
|
leveldb.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/leveldb.c b/leveldb.c
|
||||||
|
index 7b8c1bd..8a7a81d 100644
|
||||||
|
--- a/leveldb.c
|
||||||
|
+++ b/leveldb.c
|
||||||
|
@@ -380,7 +380,7 @@ int readServiceInfo(char *name, int type, struct service *service,
|
||||||
|
asprintf(&filename, RUNLEVELS "/chkconfig.d/%s", name);
|
||||||
|
if ((fd = open(filename, O_RDONLY)) >= 0) {
|
||||||
|
parseret = parseServiceInfo(fd, name, &serv_overrides, honorHide, 1);
|
||||||
|
- if (parseret >= 0) {
|
||||||
|
+ if (parseret == 0) {
|
||||||
|
if (serv_overrides.name)
|
||||||
|
serv.name = serv_overrides.name;
|
||||||
|
if (serv_overrides.levels != -1)
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user