:: Re: [DNG] dnsmasq init.d inconsiste…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Ken Dibble
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] dnsmasq init.d inconsistencies

On 1/25/25 17:50, dewaj via Dng wrote:
> On Tue, 21 Jan 2025 09:43:59 -0500
> Ken Dibble <ken@???> wrote:
>
>> The dnsmasq init.d script fails to give the correct result code under
>> certain conditions if it cannot be started.
>>
> do you mean "rc.dnsmasq" ?

The file in question is /etc/init.d/dnsmasq.
>
> if so, how does it return status if it cannot be started?


The script starts but never gets to the start() function.

Again per my previous emails:

---

line 35

# 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

----

These tests are done in the script before start(), stop() or other
functions are called.

>
> If you mean that the script returns "0" status when dnsmasq cannot be
> started, and this is a problem, then why not remove all links to
> init.d/rc.dnsmasq, and perhaps chmod a-x rc.dnsmasq, if not delete it?
> it is too easy to do.
>
> if dnsmasq is installed and executable, and that is unwanted, then it
> can also be disabled as above.


If I didn't want to run the service, then I would uninstall it or remove it.

>
> This does not seem to break anything else.
>
> Or, do it some harder or more complex way.
>
> Whatever is most favourable for you.
>
> ymmv and all.
>
> cheers
>
> --
> dj


Again per my previous emails:

---

line 35

# 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

----

These tests are done in the script before start(), stop() or anything
else is done.

It returns a value of 0 if a couple of checks fail, before any internal
functions are started.

I already fixed it for myself per my recommendations in the first email.

I foolishly thought that someone actually cared about fixing something that

was not correct (returning 0 when an error state existed),

and that I could help to make something better and save someone else
some grief.

My mistake.

Regards,

Ken