process_queues();
}
- void set_auto_restart(bool restart) noexcept
+ bool is_shutting_down() noexcept
{
- restart_enabled = restart;
+ return !restart_enabled;
}
-
- bool get_auto_restart() noexcept
- {
- return restart_enabled;
- }
-
+
shutdown_type_t get_shutdown_type() noexcept
{
return shutdown_type;
}
- // Set the shutdown type to the specified type, without issuing a shutdown order. If all services
- // stop, the shutdown type determines the action that Dinit will take.
- void set_shutdown_type(shutdown_type_t new_shutdown_type) noexcept
- {
- shutdown_type = new_shutdown_type;
- }
-
// Get an identifier for the run-time type of the service set (similar to typeid, but without
// requiring RTTI to be enabled during compilation).
virtual int get_set_type_id()
}
bool will_restart = (desired_state == service_state_t::STARTED)
- && services->get_auto_restart();
+ && !services->is_shutting_down();
for (auto & dependency : depends_on) {
// we signal dependencies in case they are waiting for us to stop:
bool service_record::do_auto_restart() noexcept
{
if (auto_restart) {
- return services->get_auto_restart();
+ return !services->is_shutting_down();
}
return false;
}