]> granicus.if.org Git - cronie/commitdiff
crond installs a signal hander for SIGINT & SIGTERM which removes the pid file and...
authorMartin Poole <mpoole@redhat.com>
Mon, 31 Mar 2014 16:02:30 +0000 (18:02 +0200)
committerMarcela Mašláňová <mmaslano@redhat.com>
Mon, 31 Mar 2014 16:02:30 +0000 (18:02 +0200)
Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
src/misc.c

index 40fc58cb0b38a8be5d500fa06f9b1602cdd71d63..d26d190056b568ab18aabbb463679010eee937e9 100644 (file)
@@ -308,6 +308,9 @@ void acquire_daemonlock(int closeflag) {
                        close(fd);
                        fd = -1;
                }
+               /* and restore default sig handlers so we don't remove pid file if killed */
+               signal(SIGINT,SIG_DFL);
+               signal(SIGTERM,SIG_DFL);
                return;
        }