if (restart_server != 0)
exit(1);
+ if ((running_as_daemon != 0) && (exitcode == 0))
+ exitcode = CTDLEXIT_SHUTDOWN;
exit(exitcode);
}
#define CTDLEXIT_OOD 104 /* Out Of Date config - rerun setup */
#define CTDLEXIT_DB 105 /* Unable to initialize database */
#define CTDLEXIT_LIBCITADEL 106 /* Incorrect version of libcitadel */
+#define CTDLEXIT_SHUTDOWN 150 /* we're going down. watcher don't
+ * fire us up again.
+ */
if (WIFEXITED(status)) {
/* Exit code 0 means the watcher should exit */
- if (WEXITSTATUS(status) == 0) {
+ if (WEXITSTATUS(status) == CTDLEXIT_SHUTDOWN) {
do_restart = 0;
}