dinit icon indicating copy to clipboard operation
dinit copied to clipboard

More consistent command output from 'dinictl enable' and 'dinitctl disable'

Open davmac314 opened this issue 1 month ago • 1 comments

The dinitctl enable command will currently wait for the named service to start and issue a 'started' message, but only if the service hasn't already started (in which case it outputs nothing).

The dinitctl disable command on the other hand doesn't wait for the service to stop. This is inconsistent. (It does print a warning if the service won't stop, i.e. target state is not 'stopped').

In both cases there is a minor race, internally: after the enable/disable is issued, a separate status command is issued to determine target state. However the state may have changed between the two commands.

davmac314 avatar Nov 04 '25 08:11 davmac314

I looked at the code of dinitctl_main in dinitctl.cc. Was the if else if else... code style intentional?

A part of me wants to rewrite this part in Lean.

iacore avatar Nov 04 '25 13:11 iacore