When a service is unpinned from pinned start, it needs to check
force_stop and stop if set.
{
if (pinned_started) {
pinned_started = false;
- if (desired_state == service_state_t::STOPPED) {
+ if (desired_state == service_state_t::STOPPED || force_stop) {
do_stop();
services->process_queues();
}
assert(s3->get_state() == service_state_t::STARTED);
assert(s2->get_state() == service_state_t::STOPPING);
assert(s1->get_state() == service_state_t::STARTED);
+
+ // 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);
}
// Test 7: stopping a soft dependency doesn't cause the dependent to stop.