This allows no stop command to be specified if none is needed. (This probably
already worked, but only because Dinit would try to exec "" (the empty string)
when the service stopped, which would fail, and the service would get marked
as stopped anyway).
}
else if (service_type == ServiceType::SCRIPTED) {
// Scripted service.
- if (! start_ps_process(stop_arg_parts, false)) {
+ if (stop_command.length() == 0) {
+ stopped();
+ }
+ else if (! start_ps_process(stop_arg_parts, false)) {
// Couldn't execute stop script, but there's not much we can do:
stopped();
}