From 48369bbc276284a26a17f39fd6523ffd5bdbebd7 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Thu, 9 Oct 2014 10:13:27 +0000 Subject: [PATCH] Daemon: Returned original check of written pidfile after start, but don't fail on quick stop. --- ucw/daemon-ctrl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ucw/daemon-ctrl.c b/ucw/daemon-ctrl.c index a7a196c0..baaf9725 100644 --- a/ucw/daemon-ctrl.c +++ b/ucw/daemon-ctrl.c @@ -165,7 +165,10 @@ daemon_control(struct daemon_control_params *dc) st = daemon_control_err(dc, "Daemon %s %s", dc->argv[0], ecmsg); goto done; } - if (st != DAEMON_STATUS_STALE) + enum daemon_control_status st2 = daemon_read_pid(dc, 0, &pid); + if (st2 != DAEMON_STATUS_OK && st2 != DAEMON_STATUS_NOT_RUNNING) + st = daemon_control_err(dc, "Daemon %s failed to write the PID file `%s'", dc->argv[0], dc->pid_file); + else if (st != DAEMON_STATUS_STALE) st = DAEMON_STATUS_OK; } break; -- 2.39.2