Re: no init scripts, what is the best way to start dnsmasq
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} != XNO -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.
no init scripts, what is the best way to start dnsmasq
Hello all, 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? And how do I call it? just 'dnsmasq' or exec dnsmasq? I have googled, but could not find a lot of info on this... Is there a way to 'install' SysV init scripts on OpenBSD? Kind regards, Coert
SOLVED: Re: no init scripts, what is the best way to start dnsmasq
On Tue, 2009-05-05 at 14:11 +0200, Coert Waagmeester wrote: Hello all, 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? And how do I call it? just 'dnsmasq' or exec dnsmasq? I have googled, but could not find a lot of info on this... Is there a way to 'install' SysV init scripts on OpenBSD? Kind regards, Coert Sorry, I did not look around long enough. I found the answer: http://www.openbsd.org/faq/faq10.html#rc and in dnsmasq(8) Sorry about that, newbie
Re: no init scripts, what is the best way to start dnsmasq
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? And how do I call it? just 'dnsmasq' or exec dnsmasq? I have googled, but could not find a lot of info on this... Is there a way to 'install' SysV init scripts on OpenBSD? 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} != XNO -a -x /usr/local/sbin/dnsmasq ]; then 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. -- Mark Shroyer http://markshroyer.com/contact/