SOLVED Restarting jail fails to autostart dnsmasq service.

Status
Not open for further replies.
Joined
Jan 4, 2014
Messages
1,644
I have created a jail in release 11.1-U4 and installed dnsmasq 2.79 (to be used as a DHCP server). The DHCP server works like a charm. However, I notice that the dnsmasq service does not autostart when the jail is restarted or the server is rebooted (dnsmasq_enable="YES" in /usr/local/etc/rc.conf). Sockstat confirms this. I have to manually start the service each time (by typing dnsmasq or service dnsmasq onestart within the jail). Any ideas where to go from here?
 
D

dlavigne

Guest
Were you able to resolve this? If not, have you thought of running a Post Init script to start it for you?
 
Joined
Jan 4, 2014
Messages
1,644
Were you able to resolve this? If not, have you thought of running a Post Init script to start it for you?

I didn't think that was going to work as it operates outside the jail. Can it be used to run a command within the jail? If so, before I mark this thread solved, I'd like to know how.

Anyway, I stumbled across a solution this evening. The clue is in this post. Adding the line service dnsmasq onestart to /etc/rc.local (in the jail), making the file executable, and then restarting the jail solved the issue.

If anyone is interested in using FreeNAS as a DHCP/DNS server, I've blogged my approach here.
 
Last edited:
Status
Not open for further replies.
Top