From: Pavel Charvat Date: Thu, 9 Oct 2014 10:13:27 +0000 (+0000) Subject: Daemon: Returned original check of written pidfile after start, but don't fail on... X-Git-Tag: v6.1.1~4 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=48369bbc276284a26a17f39fd6523ffd5bdbebd7;p=libucw.git Daemon: Returned original check of written pidfile after start, but don't fail on quick stop. --- 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;