Run command on jail start

Status
Not open for further replies.

leepfrog

Cadet
Joined
Mar 21, 2013
Messages
5
I have a program running in the jail that does not come with a startscript, does output to stdout and stderr and also does not daemonize.

I have experimented with /etc/rc.conf and what _seems_ to work is the following:

[startup command] > /dev/null 2>&1 /dev/null &

However I do believe this is not a very elegant solution. Are there any suggestions for improvements?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Put it in /etc/rc.local inside the jail. Make sure to set rc.local executable, something like "chmod 775 rc.local". This is another one of those things that needs to be added to the GUI because normally in the host rc.conf it has a parameter to start things when the jail starts. Adding your command to rc.local should be a sufficient workaround for now.
 
Status
Not open for further replies.
Top