restart jail in terminal?

Status
Not open for further replies.

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
You can restart the jail from the web GUI: just go to Jails, click on your jail, and click the reboot button on the bottom.

Unless you have a specific troubleshooting need, don't do things from the command line. Use the GUI. If you think you need to do something from the command line, that is most likely a bug or error, and fixing that should be your goal, not working around it.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
There is a very valid reason to restart a jail from the command line. Being that all jail configurations are done via CLI. ;)

I have actually wondered this myself. I always assume that just issuing a reboot or shutdown -r now (from within the jail) would work just fine.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Simply because you configure the jail environment from the command line does not necessarily mean restarting the jail (a host command) should be done from the command line.

You can't actually restart a jail from within a jail. A jail is not a fully virtualized environment, so the only way you can start a jail is from the FreeNAS command line, not the jail's. You can shutdown the jail from within the jail, but can't start it back up.

Honestly, you probably are OK with restarting a jail from the command line, but I don't know what all FreeNAS does no manage jails above and beyond standard FreeBSD, which is why I was hesitant to simply spit out the answer. To restart a jail, you use the service command on the host: https://www.freebsd.org/doc/handbook/jails-build.html (see near the bottom).

jexec [jail-number] /etc/rc.shutdown
service jail stop [jail-name]
service jail start [jail-name]
 
Status
Not open for further replies.
Top