2011-09-30 17:58:39 +02:00
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Fri, 30 Sep 2011 12:58:17 +0200
|
2013-04-13 13:09:53 +02:00
|
|
|
Subject: service: flags sysv service with detected pid as
|
|
|
|
RemainAfterExit=false
|
2011-09-30 17:58:39 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
---
|
2013-04-13 13:09:53 +02:00
|
|
|
src/core/service.c | 7 ++++++-
|
|
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
2011-09-30 17:58:39 +02:00
|
|
|
|
2013-09-13 09:25:15 +02:00
|
|
|
--- systemd-206_git201308300826.orig/src/core/service.c
|
|
|
|
+++ systemd-206_git201308300826/src/core/service.c
|
|
|
|
@@ -2100,8 +2100,13 @@ static void service_enter_running(Servic
|
2011-09-30 17:58:39 +02:00
|
|
|
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
|