SHA256
1
0
forked from pool/systemd
systemd/0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch

34 lines
1.4 KiB
Diff
Raw Normal View History

From 700b1261115a67392014ff2c887a9cffc28108ab Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Fri, 30 Sep 2011 12:58:17 +0200
Subject: [PATCH] service: flags sysv service with detected pid as RemainAfterExit=false
LSB header doesn't give pidfile, so all LSB initscripts have
RemainAfterExit=false, causing daemon termination to not be reported as
such by systemd. Checking at startup if daemon is still running for
sysv initscript to disable RemainAfterExit helps a lot.
Fixes https://bugzilla.novell.com/show_bug.cgi?id=721426
---
src/service.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
Accepting request 104941 from Base:System - Update to version 42: + Various bug fixes + Watchdog support for supervising services is now usable + Service start rate limiting is now configurable and can be turned off per service. + New CanReboot(), CanPowerOff() bus calls in systemd-logind - Dropped fix-kmod-build.patch, fix-message-after-chkconfig.patch, is-enabled-non-existing-service.patch (merged upstream) - Add libxslt1 / docbook-xsl-stylesheets as BuildRequires for manpage generation - Update to version 41: + systemd binary is now installed in /lib/systemd (symlink for /bin/systemd is available now) + kernel modules are now loaded through libkmod + Watchdog support is now useful (not complete) + new kernel command line available to set system wide environment variable: systemd.setenv + journald capabilities set is now limited + SIGPIPE is ignored by default. This can be disabled with IgnoreSIGPIPE=no in unit files. - Add fix-kmod-build.patch: fix build with libkmod - Drop remote-fs-after-network.patch (merged upstream) - Add dm-lvm-after-local-fs-pre-target.patch: ensure md / lvm /dmraid is started before mounting partitions, if fsck was disabled for them (bnc#733283). - Update lsb-header patch to correctly disable heuristic if X-Systemd-RemainAfterExit is specified (whatever its value) - Add fix-message-after-chkconfig.patch: don't complain if only sysv services are called in systemctl. OBS-URL: https://build.opensuse.org/request/show/104941 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=88
2012-02-16 16:24:03 +01:00
Index: systemd-37/src/service.c
===================================================================
--- systemd-37.orig/src/service.c
+++ systemd-37/src/service.c
@@ -2014,8 +2014,13 @@ static void service_enter_running(Servic
cgroup_ok = cgroup_good(s);
if ((main_pid_ok > 0 || (main_pid_ok < 0 && cgroup_ok != 0)) &&
- (s->bus_name_good || s->type != SERVICE_DBUS))
+ (s->bus_name_good || s->type != SERVICE_DBUS)) {
+#ifdef HAVE_SYSV_COMPAT
+ if (s->sysv_enabled && !s->pid_file)
+ s->remain_after_exit = false;
+#endif
service_set_state(s, SERVICE_RUNNING);
+ }
else if (s->remain_after_exit)
service_set_state(s, SERVICE_EXITED);
else