Contents
init is parent of all Linux processes with PID or process ID of 1. It is the first process to start when a computer boots up and runs until the system shuts down.
What does init do Linux?
Init is the parent of all processes, executed by the kernel during the booting of a system. Its principle role is to create processes from a script stored in the file /etc/inittab. It usually has entries which cause init to spawn gettys on each line that users can log in.
How use init command in Linux?
Run Level Commands:
- Shutdown: init 0. shutdown -h now. -a: Use file /etc/shutdown.allow. -c: Cancel scheduled shutdown. halt -p. -p: Turn power off after shutdown. poweroff.
- Reboot: init 6. shutdown -r now. reboot.
- Enter single user mode: init 1.
- Check current runlevel: runlevel.