Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169492 - net-dns/dnsmasq-2.34 (actually all versions) ignores DNSMASQ_OPTS
Summary: net-dns/dnsmasq-2.34 (actually all versions) ignores DNSMASQ_OPTS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-05 19:17 UTC by Tyler Montbriand
Modified: 2007-03-23 13:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for /etc/init.d/dnsmasq (dnsmasq.patch,365 bytes, patch)
2007-03-05 19:21 UTC, Tyler Montbriand
Details | Diff
another patch for /etc/init.d/dnsmasq (diff,401 bytes, patch)
2007-03-07 14:12 UTC, Matthias Foerste
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Montbriand 2007-03-05 19:17:36 UTC
Due to a small mistake in /etc/init.d/dnsmasq, the DNSMASQ_OPTS variable from
/etc/conf.d/dnsmasq never gets used; more precisely, dnsmasq itself is told
to ignore them.

Reproducible: Always

Steps to Reproduce:
1.  Set DNSMASQ_OPTS="-Z" in /etc/conf.d/dnsmasq
1.  /etc/init.d/dnsmasq restart
2.  ps aux | grep dnsmasq


Actual Results:  
nobody    4874  0.0  0.1   1788   744 ?        S    12:57   0:00 /usr/sbin/dnsmasq pidfile /var/run/dnsmasq.pid -- -x /var/run/dnsmasq.pid -Z

Expected Results:  
See the "--" in there?  That tells dnsmasq to ignore all options after it, including the ones from DNSMASQ_OPTS.  In this case, it doesn't read any MAC addresses from /etc/ethers, and gives out random reservations instead.  This can really mess up a static IP setup :)

I'll attach a patch of my fix.

Portage 2.1.2.1 (default-linux/x86/2006.1/server, gcc-4.1.1, glibc-2.4-r4, 2.6.19-gentoo-r5 i686)
=================================================================
System uname: 2.6.19-gentoo-r5 i686 Pentium III (Coppermine)
Gentoo Base System release 1.12.9
Timestamp of tree: Mon, 05 Mar 2007 19:00:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.3.5-r3, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -pipe -O2"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"
CXXFLAGS="-march=pentium3 -pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apache2 berkdb bitmap-fonts cli cracklib crypt cups dri fortran gdbm gpm iconv ipv6 isdnlog ldap libg++ mailwrapper midi mysql mysqli ncurses nls nptl nptlonly pam pcre perl php ppds pppd python readline reflection samba session snmp spl ssl tcpd truetype truetype-fonts type1-fonts unicode x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark ati chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mga neomagic nsc nv rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Tyler Montbriand 2007-03-05 19:21:13 UTC
Created attachment 112206 [details, diff]
Patch for /etc/init.d/dnsmasq
Comment 2 Matthias Foerste 2007-03-07 14:12:01 UTC
Created attachment 112414 [details, diff]
another patch for /etc/init.d/dnsmasq

I had a similar Problem with the -r option being ignored. Actually the first "--" tells start-stop-daemon to pass all arguments after it to pass to the exec to start which should probably read "--pidfile" instead. Attached patch works for me.
Comment 3 Wernfried Haas (RETIRED) gentoo-dev 2007-03-23 10:03:57 UTC
It used to work for me in 2.34, but broke when upgrading to 2.38. After a downgrade to 2.34, it was also broken there (well, it's the same init script after all).
Since this breaks all versions (at least for all users relying on the DNSMASQ_OPTS), please fix this rather sooner than later as it also breaks anyone upgrading from 2.34 to 2.38 (which was stabled quite recently on x86).
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-03-23 10:44:40 UTC
Fixed. Sorry about that - my fault.
Comment 5 Wernfried Haas (RETIRED) gentoo-dev 2007-03-23 13:42:19 UTC
Thanks a lot for responding that quickly after i poked you on IRC, Roy. :-)
DNSMASQ_OPTS seems to work fine again.