diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-10-10 18:08:18 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-10-13 17:56:02 +0200 |
commit | 695e5d209ade018afea1b2d2f9e042e9c78028ae (patch) | |
tree | 8cb680a03f4c610cbab2b9bb8e1525cf146cad81 /console-client | |
parent | fd8213f83d0656bd0cd5215306e22e5a25058bee (diff) |
console-client: remove the pid file on clean exits
Remove the pid file if the console client exits either cleanly using
console_exit or because of an error during daemonization.
* console-client/console.c (console_exit): Remove the pid file.
(daemon_error): Likewise.
Diffstat (limited to 'console-client')
-rw-r--r-- | console-client/console.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/console-client/console.c b/console-client/console.c index f995ca2e..a9f8368b 100644 --- a/console-client/console.c +++ b/console-client/console.c @@ -275,6 +275,10 @@ void console_exit (void) { driver_fini (); +#if HAVE_DAEMON + if (daemonize) + daemon_pid_file_remove (); +#endif /* HAVE_DAEMON */ exit (0); } @@ -626,6 +630,7 @@ static struct argp startup_argp = {options, parse_opt, 0, { \ /* Signal parent. */ \ daemon_retval_send (status); \ + daemon_pid_file_remove (); \ return 0; \ } \ } \ |