Solved how to correctly power off jail in freebsd14.2 ?

dear all:
i have machine with freebsd14.2 . now create a jail with bastille.
question:
how to correctly poweroff this jail in freebsd14.2 ?

1. i can use bastille stop jail for poweroff jail.. that's work normal .
2. other way . i don't use bastille stop jail. the jail was still running. i poweroff the host directly , is that right or will make a big problem for system ? what is is the best way ?

thanks
 
If you used the "proper" shutdown -p now, /etc/rc.shutdown is executed and services will all be sent a "stop", in the reverse order they were started.
DEar sirdice :
i have used "poweroff" as root to shutdown host , is that right ?

my step was : when all jail was running , then login host , input "poweroff" . that is right ? thanks.
do i must use bastille stop all jails first . then input "poweroff" for host to shutdown machine ? thanks.
 
If you use Bastille, it will do all this for you when you do ‘bastille start…’ and ‘bastille stop…’
dear victort:
yes, i know bastille can do that step . my question was i don't stop all jails. just use root ,input "poweroff" host , is that right ? or make a big problems for my freebsd14.2 system . thanks .
 
dear victort:
yes, i know bastille can do that step . my question was i don't stop all jails. just use root ,input "poweroff" host , is that right ? or make a big problems for my freebsd14.2 system . thanks .
Oh I see.

So you are wondering how to make sure the jails are properly stopped when doing the “poweroff” command?
 
DEar sirdice :
i have used "poweroff" as root to shutdown host , is that right ?

poweroff(8) and shutdown -p are aliases of each other.

my step was : when all jail was running , then login host , input "poweroff" . that is right ? thanks.
do i must use bastille stop all jails first . then input "poweroff" for host to shutdown machine ? thanks.
Simply use poweroff.

Never use halt -p or reboot. Both of these commands have original BSD (and Solaris and UNIX) semantics. They issue the system call directly without the niceties of rc scripts.

Linux had broken with tradition by aliasing reboot and halt with shutdown but as of systemd, shutdown, poweroff, reboot, and halt are now aliases for various systemctl commands. The new guys in our team use systemctl reboot and systemctl poweroff commands, as this is the preferred approach. I suspect Linux will eventually remove the shutdown, poweroff, reboot, and halt commands in lieu of systemctl in order to simplify documentation. This is what they're teaching new sysadmins coming into our team. Sadly, outside of *BSD it's a systemd world out there.
 
I’d like to jump in here and ask why to the “don’t use reboot” statement.

What if I do want to reboot, the poweroff will shut it down, but without WOL or something similar, how do you start it again remotely?
 
I’d like to jump in here and ask why to the “don’t use reboot” statement.
The reboot and halt commands just blindly sends a SIGTERM to all processes. The shutdown(8) command (and its aliases) runs /etc/rc.shutdown and sends all the rc(8) scripts a "stop", so services are stopped in reverse order they have been started. Sometimes rc(8) scripts and/or daemons have some additional shutdown/cleanup procedures besides just killing the process. Or need to be stopped in order (one service might depend on another).
 
Back
Top