From: Davin McCall Date: Sat, 16 Jan 2016 14:45:52 +0000 (+0000) Subject: Only enable console logging via the service layer (when no services X-Git-Tag: v0.01~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d45bc89ff08f0163971693f7115adeb5bfcf8cc;p=oweals%2Fdinit.git Only enable console logging via the service layer (when no services are using the console). --- diff --git a/src/control.cc b/src/control.cc index 3488b85..30dd316 100644 --- a/src/control.cc +++ b/src/control.cc @@ -41,7 +41,6 @@ void ControlConn::processPacket() auto sd_type = static_cast(rbuf[1]); service_set->stop_all_services(sd_type); - enable_console_log(true); char ackBuf[] = { DINIT_RP_ACK }; if (! queuePacket(ackBuf, 1)) return; diff --git a/src/dinit.cc b/src/dinit.cc index 9e59dd4..311c05f 100644 --- a/src/dinit.cc +++ b/src/dinit.cc @@ -458,7 +458,6 @@ void close_control_socket(struct ev_loop *loop) noexcept /* handle SIGINT signal (generated by kernel when ctrl+alt+del pressed) */ static void sigint_reboot_cb(struct ev_loop *loop, ev_signal *w, int revents) { - enable_console_log(true); service_set->stop_all_services(ShutdownType::REBOOT); } @@ -476,6 +475,5 @@ static void sigquit_cb(struct ev_loop *loop, ev_signal *w, int revents) /* handle SIGTERM/SIGQUIT - stop all services (not used for system daemon) */ static void sigterm_cb(struct ev_loop *loop, ev_signal *w, int revents) { - enable_console_log(true); service_set->stop_all_services(); }