Systemd is a popular init system used in many Linux distributions to manage the startup and management of services and processes. However, not all systems use systemd, and in some cases, you may need to reboot a system that is not started with systemd. In this article, we will guide you through the steps to reboot a system without systemd.
1. Check the init system
The first step is to determine the init system used by your system. There are several init systems in use, such as SysV, Upstart, and OpenRC. To check the init system, you can run the following command in the terminal:
$ ps -p 1 -o comm=
This command will display the name of the init system running on your system. Make a note of the init system as it will be used in the subsequent steps.
2. Reboot using SysV init
If your system is using the SysV init system, you can reboot it by running the following command:
$ sudo shutdown -r now
This command will initiate an immediate system reboot. You may need to enter your password to execute this command as it requires root privileges.
3. Reboot using Upstart init
If your system is using the Upstart init system, you can reboot it by running the following command:
$ sudo initctl reboot
Similar to the previous command, you may be prompted to enter your password to execute this command with root privileges.
4. Reboot using OpenRC init
If your system is using the OpenRC init system, you can reboot it by running the following command:
$ sudo rc-service reboot
Again, you may need to provide your password to execute this command as it requires root privileges.
5. Reboot using other init systems
If your system is using an init system other than SysV, Upstart, or OpenRC, you will need to consult the documentation or support resources specific to that init system to determine the appropriate command to reboot the system.
6. Graceful shutdown
Before rebooting the system, it is always a good practice to perform a graceful shutdown. This ensures that all running processes and services are properly terminated before the system restarts. To initiate a graceful shutdown, you can run the following command:
$ sudo shutdown -h now
This command will initiate an immediate shutdown of the system. Again, you may need to enter your password to execute this command with root privileges.
Conclusion
In this article, we have discussed how to reboot a system that is not started with systemd. We covered the steps for rebooting systems using different init systems such as SysV, Upstart, and OpenRC. Remember to always perform a graceful shutdown before rebooting the system to ensure the proper termination of processes and services.
References
| Source | Link |
|---|---|
| Linux man page - shutdown | https://man7.org/linux/man-pages/man8/shutdown.8.html |
| Ubuntu Documentation - Upstart | https://help.ubuntu.com/community/Upstart |
| Gentoo Wiki - OpenRC | https://wiki.gentoo.org/wiki/OpenRC |