Brian Vanderburg II wrote: > Package: dnsmasq > Version: 2.45-1+lenny1 > Severity: important > > > When running dnsmasq command with command line arguments, specifying a > custom pid file does not work if one types '--pid-file /path/to/pid'. > It does work if one types '-x /path/to/pid'. It also works if one types > '--pid-file=/path/to/pid'. The program runs fine when executed with > ''--pid-file /path/to/pid' but it does not create the pid file. > > While this does not pose an operation problem, if one executes the > command with one set of options in one style, they would likely specify > the options consistenly. That is, if they use an equal sign for one > option they would likely use them for other options, but if they don't > use them for one they would likely not use them for others. > > However, it seems that some options do not work with an equal sign, such > as --server, --dhcp-range, --port. dnsmasq quits with an error about > command line arguments. So one must use an equal sign with --pid-file > (or use the short form -x) but not with --server/--port/etc. > > >
Dnsmasq uses gnu-getopt, which does have a standard representation: either -x <arg> or --long-opt=<arg> In this case --pidfile without the '=' is equivalent to --pidfile= ie, it sets the pidfile to be nothing, which is allowed and a sensible thing to do (it stops any pidfile from being written). --pid-file filename is therefore interpreted as setting the pidfile to be nothing, and then a non-option argument to dnsmasq which is nothing to do with the pid-file option, in the same way that in ls -l file the file is not associated with "-l" The confusion here is that dnsmasq doesn't use non-option arguments, so the filename is simply ignored. I've modified it to complain and die if non-option arguments are present, which should be less confusing. Your example now goes like this: s...@spike:~/dnsmasq-2.56/dnsmasq-2.56$ src/dnsmasq --pid-file gfgf dnsmasq: junk found in command line which is not what you wanted, but at least it makes you look again and avoids accepting a command line which doesn't do what it look like it should do. HTH Simon. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org