The pin should prevent the process from stopping, but not from any other
effects on dependencies. This change makes dependencies of a
start-pinned service potentially go into STOPPING state, if the pinned
service is issued a stop.
void service_record::do_stop() noexcept
{
- if (pinned_started) return;
-
// A service that does actually stop for any reason should have its explicit activation released, unless
// it will restart:
if (start_explicit && ! do_auto_restart()) {
}
}
+ if (pinned_started) return;
+
service_state = service_state_t::STOPPING;
waiting_for_deps = true;
if (all_deps_stopped) {
s2->stop(true);
sset.process_queues();
- // s3 should remain started:
+ // s3 should remain started due to pin:
assert(s3->get_state() == service_state_t::STARTED);
assert(s2->get_state() == service_state_t::STOPPING);
- assert(s1->get_state() == service_state_t::STARTED);
+ assert(s1->get_state() == service_state_t::STOPPING);
// If we now unpin, s3 should stop:
s3->unpin();
sset.process_queues();
assert(s3->get_state() == service_state_t::STOPPED);
assert(s2->get_state() == service_state_t::STOPPED);
- // s1 will stop because it is no longer required:
assert(s1->get_state() == service_state_t::STOPPED);
}