Mark Shroyer wrote: > On Tue, May 05, 2009 at 02:11:57PM +0200, Coert Waagmeester wrote: >> I have installed dnsmasq on OpenBSD. >> >> What is the best way to start it? Should I start it >> from /etc/rc.securelevel, or rc.local?
> It's best not to think of this in terms of SysV-style init scripts. In > OpenBSD, shell commands in /etc/rc.local get run at boot time, so all > you have to do is put some command in there to launch dnsmasq in any > fashion that you see fit. So it would suffice to simply add a line with > "/usr/local/sbin/dnsmasq"; however, for consistency with the way things > are launched in /etc/rc, I generally do something like the following: > > ,--- /etc/rc.local ----------- > if [ X"${dnsmasq_flags-NO}" != X"NO" -a -x /usr/local/sbin/dnsmasq ]; then ^^^ Ooh how lovely to see someone else doin this! :-) For the archives - if used consequently, this way makes it amazingly easy to start only certain services via /etc/rc.local; e.g. $ sudo dnsmasq_flags= sh /etc/rc.local while $ sudo sh /etc/rc.local would not start anything (well, unless you have stupid names for the variables in your /etc.rc that matches eported variables from the shell and sudo is set up to pass these on. That should not be the case very often) /Alexander > echo -n ' dnsmasq'; /usr/local/sbin/dnsmasq ${dnsmasq_flags} > fi > `----------------------------- > > ,--- /etc/rc.conf.local ------ > dnsmasq_flags= > `----------------------------- > > This way, if you want to temporarily disable dnsmasq, you can simply > remove the line in rc.conf.local or change it to "dnsmasq_flags=NO".