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.
Activity
6I 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.
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.
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.
The race is fixed and "dinitctl disable" now waits for the service to stop, see d7d843bdb9c8e5719d78fa3240919239266db378 and 2b255396dc2ed54cbc9ba34b68d17e247ca1d6ea
The race is fixed and "dinitctl disable" now waits for the service to stop, see d7d843bdb9c8e5719d78fa3240919239266db378 and 2b255396dc2ed54cbc9ba34b68d17e247ca1d6ea
I looked at the code of
dinitctl_mainin dinitctl.cc. Was theif else if else...code style intentional?A part of me wants to rewrite this part in Lean.