#507

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

Opendavmac314opened 1y ago

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

6
iacore1y ago

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.

iacore1y ago

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.

iacore1y ago

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.

iacore1y ago

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.

davmac3143mo ago

The race is fixed and "dinitctl disable" now waits for the service to stop, see d7d843bdb9c8e5719d78fa3240919239266db378 and 2b255396dc2ed54cbc9ba34b68d17e247ca1d6ea

davmac3143mo ago

The race is fixed and "dinitctl disable" now waits for the service to stop, see d7d843bdb9c8e5719d78fa3240919239266db378 and 2b255396dc2ed54cbc9ba34b68d17e247ca1d6ea