How can I auto run a program when the jail starts?

Status
Not open for further replies.

dabone

Dabbler
Joined
Aug 28, 2012
Messages
10
I've manually installed the syncrify server into the jail enviroment, but I can't seem to find how to make sure it starts along with the jail.

I've added the following script into the /etc/rc.d and I can start it using the script, but it's not starting with the jail.

__________________________________________
#!/bin/sh

. /etc/rc.subr
name="syncrify"
rcvar=syncrify_enable

start_cmd="${name}_start"
stop_cmd=":"

syncrify_start(){
cd /syncrify
./run.sh
}
load_rc_config $name
run_rc_command "$1"
__________________________________________

I've also got the following line in /etc/rc.conf

syncrify_enable="YES"

I'm a bit clueless here, thanks in advance for the help.

Later,
Mark
 

dabone

Dabbler
Joined
Aug 28, 2012
Messages
10
No difference. Is there a rc.local option or something with a jail?

Thanks.
Mark
 

dabone

Dabbler
Joined
Aug 28, 2012
Messages
10
Ok, I was a idiot, the start script was running, but the run.sh assumed java was in the path, but because of the way I'm starting it, the script couldn't find java.
I just edited the run.sh to include the full path to java and it starts right up.


Thanks.
Later,
Mark
 

Govind

Cadet
Joined
Feb 21, 2014
Messages
1
I am new to FreeNAS and am faced with the exact same situation could you through more light on exactly what you did?
 
Status
Not open for further replies.
Top