]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
Use different command to reboot linux VM, depending on the init system type
authorKruti Pendharkar <kp025370@broadcom.com>
Tue, 30 Sep 2025 06:03:43 +0000 (23:03 -0700)
committerKruti Pendharkar <kp025370@broadcom.com>
Tue, 30 Sep 2025 06:03:43 +0000 (23:03 -0700)
commit7ff34bef69c7252fb0ceb628f64103b0fa4f56f2
treedb2a2c843bd74443109b0889ed0865deb95ea2de
parent7e8d6f072381e606c0c211069c3ba14582e9b30e
Use different command to reboot linux VM, depending on the init system type

We currently use the "telinit 6" command to reboot linux VMs.
However, the "telinit" command will be unavailable in the future as SysVinit
will be deprecated on some modern linux systems.

For example: In SUSE, "telinit" command is part of systemd-sysvcompat
(15 SP6 and newer) or systemd-sysvinit (older than 15 SP6), whereas in some
SUSE images or templates such as SUSE minimal VM has no such packages installed.
See SUSE KB: https://www.suse.com/support/kb/doc/?id=000021564

This change detects the init system of a linux and uses different command
to trigger reboot. If the modern init system, systemd, is available, then
"systemctl reboot" command will be used to trigger reboot. Otherwise, continue
using "telinit 6" command as SysVinit, the traditional init system, is still
available.
open-vm-tools/libDeployPkg/linuxDeployment.c