diff --git a/src/daemon/PhutilDaemon.php b/src/daemon/PhutilDaemon.php --- a/src/daemon/PhutilDaemon.php +++ b/src/daemon/PhutilDaemon.php @@ -368,7 +368,7 @@ 'down' => 'optional int', 'pool' => 'optional int', 'clone' => 'optional bool', - 'reserve' => 'optional float', + 'reserve' => 'optional int|float', )); $this->autoscaleProperties = $autoscale_properties; diff --git a/src/daemon/PhutilDaemonHandle.php b/src/daemon/PhutilDaemonHandle.php --- a/src/daemon/PhutilDaemonHandle.php +++ b/src/daemon/PhutilDaemonHandle.php @@ -352,6 +352,11 @@ public function didReceiveGracefulSignal($signo) { $this->shouldShutdown = true; + if (!$this->isRunning()) { + // If we aren't running a daemon, emit this event now. Otherwise, we'll + // emit it when the daemon exits. + $this->dispatchEvent(self::EVENT_WILL_EXIT); + } $signame = phutil_get_signal_name($signo); if ($signame) {