Loading init/init.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -235,15 +235,6 @@ static class ShutdownState { // action queue. Instead we set this flag and ensure that shutdown happens before the next // command is run in the main init loop. auto lock = std::lock_guard{shutdown_command_lock_}; if (do_shutdown_) { LOG(ERROR) << "TriggerShutdown called while a previous shutdown command '" << shutdown_command_ << "' has not been handled"; UnwindMainThreadStack(); } if (IsShuttingDown()) { LOG(ERROR) << "TriggerShutdown called while init is already shutting down"; UnwindMainThreadStack(); } shutdown_command_ = command; do_shutdown_ = true; WakeMainInitThread(); Loading @@ -258,12 +249,27 @@ static class ShutdownState { return {}; } bool do_shutdown() const { return do_shutdown_; } private: std::mutex shutdown_command_lock_; std::string shutdown_command_; bool do_shutdown_ = false; } shutdown_state; void DebugRebootLogging() { LOG(INFO) << "do_shutdown: " << shutdown_state.do_shutdown() << " IsShuttingDown: " << IsShuttingDown(); if (shutdown_state.do_shutdown()) { LOG(ERROR) << "sys.powerctl set while a previous shutdown command has not been handled"; UnwindMainThreadStack(); } if (IsShuttingDown()) { LOG(ERROR) << "sys.powerctl set while init is already shutting down"; UnwindMainThreadStack(); } } void DumpState() { ServiceList::GetInstance().DumpState(); ActionManager::GetInstance().DumpState(); Loading init/init.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ void SendLoadPersistentPropertiesMessage(); void PropertyChanged(const std::string& name, const std::string& value); bool QueueControlMessage(const std::string& message, const std::string& name, pid_t pid, int fd); void DebugRebootLogging(); int SecondStageMain(int argc, char** argv); } // namespace init Loading init/property_service.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -489,6 +489,7 @@ uint32_t HandlePropertySet(const std::string& name, const std::string& value, } LOG(INFO) << "Received sys.powerctl='" << value << "' from pid: " << cr.pid << process_log_string; DebugRebootLogging(); } // If a process other than init is writing a non-empty value, it means that process is Loading Loading
init/init.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -235,15 +235,6 @@ static class ShutdownState { // action queue. Instead we set this flag and ensure that shutdown happens before the next // command is run in the main init loop. auto lock = std::lock_guard{shutdown_command_lock_}; if (do_shutdown_) { LOG(ERROR) << "TriggerShutdown called while a previous shutdown command '" << shutdown_command_ << "' has not been handled"; UnwindMainThreadStack(); } if (IsShuttingDown()) { LOG(ERROR) << "TriggerShutdown called while init is already shutting down"; UnwindMainThreadStack(); } shutdown_command_ = command; do_shutdown_ = true; WakeMainInitThread(); Loading @@ -258,12 +249,27 @@ static class ShutdownState { return {}; } bool do_shutdown() const { return do_shutdown_; } private: std::mutex shutdown_command_lock_; std::string shutdown_command_; bool do_shutdown_ = false; } shutdown_state; void DebugRebootLogging() { LOG(INFO) << "do_shutdown: " << shutdown_state.do_shutdown() << " IsShuttingDown: " << IsShuttingDown(); if (shutdown_state.do_shutdown()) { LOG(ERROR) << "sys.powerctl set while a previous shutdown command has not been handled"; UnwindMainThreadStack(); } if (IsShuttingDown()) { LOG(ERROR) << "sys.powerctl set while init is already shutting down"; UnwindMainThreadStack(); } } void DumpState() { ServiceList::GetInstance().DumpState(); ActionManager::GetInstance().DumpState(); Loading
init/init.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ void SendLoadPersistentPropertiesMessage(); void PropertyChanged(const std::string& name, const std::string& value); bool QueueControlMessage(const std::string& message, const std::string& name, pid_t pid, int fd); void DebugRebootLogging(); int SecondStageMain(int argc, char** argv); } // namespace init Loading
init/property_service.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -489,6 +489,7 @@ uint32_t HandlePropertySet(const std::string& name, const std::string& value, } LOG(INFO) << "Received sys.powerctl='" << value << "' from pid: " << cr.pid << process_log_string; DebugRebootLogging(); } // If a process other than init is writing a non-empty value, it means that process is Loading