[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: invoke-rc.d & systemd



Andre Majorel writes:
> I'm working on a program to make changes to a daemon's
> configuration file. The man page helpfully warns against doing
> that without immediately restarting it.
>
> Do you think the following would work on any Debian system,
> regardless of its current run level and choice of init system ?
>
> 1. run invoke-rc.d daemon-package stop
> 2. update config file
> 3. run invoke-rc.d daemon-package start

That might behave different than expected when current state of the
daemon and the boot configuration differ: for example the sequence above
will start the daemon if it was not running before but is configured to
start at boot; or it will stop the daemon if it was manually started but
is not configured to start automatically at boot.

systemctl has a `try-restart` option that might be helpful in such
cases, but this is optional for LSB init scripts (yay...).  `reload`
would also work if supported.

Ansgar


Reply to: