chiark / gitweb /
service: 'pidfile:' in SysV chkconfig header implies a real daemon
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 5 Jul 2011 08:14:12 +0000 (10:14 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Tue, 5 Jul 2011 08:17:42 +0000 (10:17 +0200)
The presence of the chkconfig "pidfile:" header in the initscript is an
excellent indication that it's not a oneshot script (like iptables),
but a real daemon (like httpd).

src/service.c

index 165655eb124c8bc200d69f0e642eced721970932..5c7e62f3b0f3f24cf7430ba5c769891468d23e12 100644 (file)
@@ -843,7 +843,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
 
         /* Special setting for all SysV services */
         s->type = SERVICE_FORKING;
 
         /* Special setting for all SysV services */
         s->type = SERVICE_FORKING;
-        s->remain_after_exit = true;
+        s->remain_after_exit = !s->pid_file;
         s->restart = SERVICE_RESTART_NO;
         s->exec_context.std_output =
                 (s->meta.manager->sysv_console || s->exec_context.std_input == EXEC_INPUT_TTY)
         s->restart = SERVICE_RESTART_NO;
         s->exec_context.std_output =
                 (s->meta.manager->sysv_console || s->exec_context.std_input == EXEC_INPUT_TTY)