autostart in jail

Status
Not open for further replies.

mrMuppet

Contributor
Joined
Mar 14, 2014
Messages
192
Hi,

i recently installed two new jails for me, but i didn't get it to run automatically.
The software in the 1st jail is startet via “node ccu.io-server.js start”.
The software in the 2nd jail is startet via “java -jar ccu-historian.jar”. In this case its very special because the Server is only running as long as i am connected with my putty.

Where do i have to place the autostart commands? How do i have to change it?

I hope you can help me to get both startet automatically!

Thanks alot!
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Run it using an rc script.
More details here.
 

mrMuppet

Contributor
Joined
Mar 14, 2014
Messages
192
wow. thats looks quite complicated... isn't there any easier way by using the init-script thing in the webIF?
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
If you don't mind running it manually, you can install tmux in your jail and run it with that. It'll stay running even if you disconnect from PuTTY.

Install: pkg install tmux (you may/may not have to do pkg update beforehand).
Run it: tmux
Run your java jar as normal.

That's it.

Few extra things you may want to know about tmux:
  • To detach your tmux session: CTRL-B then d
  • To reattach to a running tmux session: tmux att
Another way is (not quite sure how well this one will work), but you could probably try adding a script to your crontab.
 
Last edited:
Status
Not open for further replies.
Top