[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] console-client: remove the pid file on clean exits
From: |
Justus Winter |
Subject: |
[PATCH 1/5] console-client: remove the pid file on clean exits |
Date: |
Thu, 10 Oct 2013 18:08:18 +0200 |
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.
---
console-client/console.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/console-client/console.c b/console-client/console.c
index f995ca2..a9f8368 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; \
} \
} \
--
1.7.10.4
- [PATCH 1/5] console-client: remove the pid file on clean exits,
Justus Winter <=
- [PATCH 3/5] console-client: replace function epilogue with console_exit, Justus Winter, 2013/10/10
- [PATCH 2/5] console-client: entitle console_exit with the noreturn attribute, Justus Winter, 2013/10/10
- [PATCH 4/5] console-client: minor stylistic fix, Justus Winter, 2013/10/10
- [PATCH 5/5] console-client: fix error handling, Justus Winter, 2013/10/10
- Re: [PATCH 1/5] console-client: remove the pid file on clean exits, Samuel Thibault, 2013/10/13