:: Re: [DNG] dnsmasq init.d inconsiste…
Inizio della pagina
Delete this message
Reply to this message
Autore: Dan Purgert
Data:  
To: dng
Oggetto: Re: [DNG] dnsmasq init.d inconsistencies
On Jan 21, 2025, Ken Dibble wrote:
>
> The dnsmasq init.d script fails to give the correct result code under
> certain conditions if it cannot be started.
>
> # 0 if daemon started
> # 1 if daemon was already running
> # 2 if daemon could not be started
> [...]
>
> # The following test ensures the dnsmasq service is not started, when the
> # package 'dnsmasq' is removed but not purged, even if the dnsmasq-base
> # package is still in place.
> test -e /usr/share/dnsmasq/installed-marker || exit 0
>
> test -x ${DAEMON} || exit 0
>
>
> This is inconsistent with the documentation in start() and one could
> certainly make the case that returning no error when an error has
> occurred is a bad thing.


I believe that it's on purpose, because the operator has created a state
where dnsmasq cannot conceivably start (it's uninstalled), and yet has
left an init script that tries to bring it up.

If there were any scripts relying on this one to come up cleanly, they
wouldn't start.




--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860