Working with different OSs can be quite challenging (mentally :-)). I wonder why the command "halt" has not same result between EL6 and EL8. To shutdown the vm or workstation in EL8 i must use "shutdown now". Who mandates this behavior in terms of configuration file? -- Leon
On Sun, Jun 14, 2020 at 4:32 PM Leon Fauster via CentOS <centos at centos.org> wrote:> Working with different OSs can be quite challenging (mentally :-)). > > I wonder why the command "halt" has not same result between EL6 and EL8. > > To shutdown the vm or workstation in EL8 i must use "shutdown now". >fwiw, i've always used 'init 0' to shut down all sorts of unix/linux systems. On old school unix, and I think even early Linux, halt was an /immediate/ halt, as in catch fire. might as well hit the power switch.
On Mon, 2020-06-15 at 01:32 +0200, Leon Fauster via CentOS wrote:> Working with different OSs can be quite challenging (mentally :-)). > > I wonder why the command "halt" has not same result between EL6 and EL8. > > To shutdown the vm or workstation in EL8 i must use "shutdown now". > > Who mandates this behavior in terms of configuration file? >It's to do with systemd. EL6 used SysV based init and runlevels, EL7 & EL8 use systemd targets. If you look at the halt and shutdown commands they are symlinks to /usr/bin/systemctl now and they are implemented as shims that replicate the effect of the old SysV processes. So the following have the same effect: "systemctl isolate halt.target" "halt" "shutdown -H now" "systemctl halt" there are equivalents for "poweroff" and "reboot" as well. P.
> fwiw, i've always used 'init 0' to shut down all sorts of unix/linux > systems.In EL7/EL8, init is now a symlink as well because everything is controlled by systemd.> On old school unix, and I think even early Linux, halt was an > /immediate/ halt, as in catch fire. might as well hit the power switch. >Not quite. Shutdown is a timed thing so you can tell it to shutdown or reboot at a certain time or after a certain delay and it can broadcast messages to the users - it's useful on multi-user systems to be able to warn users that the system is about to go down. Halt is an immediate thing without any broadcast messages or delay but it does do the halt cleanly. There is an option to halt to not sync the disks - this is not a wise thing to do and is an emergency option - certainly the original man pages for halt said something like "only do this if your disks are on fire". P.