Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#26515 - [dnsmasq] rc.d bad output

Attached to Project: Arch Linux
Opened by Sébastien Luttringer (seblu) - Wednesday, 19 October 2011, 02:14 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 19 October 2011, 16:22 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Paul Mattal (paul)
Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

dnsmasq rc.d start script seems a little bugged because it call dnsmasq --test which writes text on stderr.

I see 3 issues:
1- stderr should be reserved for errors and there is no errors
2- starting dnsmasq in background will display the sytax check OK somewhere because stderr is no redirected to /dev/null
3- starting dnsmasq in foregroup will have a bad display like the following

# /etc/rc.d/dnsmasq start
:: Starting DNS/DHCP daemon [BUSY] dnsmasq: syntax check OK.
[DONE]

A trivial fix would be:

--- /etc/rc.d/dnsmasq 2011-09-11 18:04:31.000000000 +0200
+++ dnsmasq 2011-10-19 04:14:02.230296435 +0200
@@ -17,7 +17,7 @@
case $1 in
start)
stat_busy "Starting DNS/DHCP daemon"
- if [[ -z $PID ]] && /usr/sbin/dnsmasq --test &&
+ if [[ -z $PID ]] && /usr/sbin/dnsmasq --test &>/dev/null &&
/usr/sbin/dnsmasq "--user=${DNSMASQ_USER:-nobody}" \
"--pid-file=$pidfile" \
"${DNSMASQ_OPTS[@]}"; then
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 19 October 2011, 16:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  extra/dnsmasq 2.59-2
Comment by Dave Reisner (falconindy) - Wednesday, 19 October 2011, 09:55 GMT
Directing output to /dev/null would defeat half the purpose of the syntax check when it fails and throws descriptive information for the user.
Comment by Sébastien Luttringer (seblu) - Wednesday, 19 October 2011, 10:34 GMT
"dnsmasq --test" print on stderr even there is no errors :(

my patch was trivial, but we can also only print output of "dnsmasq --test" when return code != 0. Which restore the half of the missing purpose.

In other hand, if starting fail, users will do an /etc/rc.d/dnsmasq checkconfig to see what's wrong.

I attached a new patch
Comment by Dave Reisner (falconindy) - Wednesday, 19 October 2011, 12:47 GMT
Or we can capture the output and conditionally print it if --test fails... I'll push something a little later today.

Loading...