What is the PID for /sbin/init?
Which tool will print the current runlevel?
Which tool will switch from one runlevel to another?
How can you force init to read its configuration file?
killall -HUP init
kill -1 1
init restart
init q
Table 2.5. Files
| Files | Description |
|---|---|
/etc/init.d/ | directory containing all the scripts used to stop and start services at boot time |
/etc/inittab | See inittab(5).
The inittab file describes which processes are started
at boot-up and during normal operation. init
distinguishes multiple runlevels, each of which can have its own set
of processes that are started |
Table 2.6. Commands
| Commands | Description |
|---|---|
| init | See init(8).
init is the parent of all processes. Its primary role
is to create processes from a script stored in the file
/etc/inittab |
| shutdown | See shutdown(8).
It brings the system down in a secure way. All logged-in users are
notified that the system is going down, and
login(1)
is blocked. It is possible to shut the system down immediately or after
a specified delay. All processes are first notified that the system is
going down by the signal SIGTERM.
This gives programs like
vi(1)
the time to save the file being edited, mail and news processing programs
a chance to exit cleanly, etc. shutdown does its job
by signalling the init process, asking it to change
the runlevel |
Use init to change your current runlevel (eg swtich between runlevel 3 and 5).
- Print your current runlevel?
Edit /etc/inittab
replace the shutdown command with shutdown -r -k -t1 now
save the file and make init reread its configuration file (eg run: killall -HUP init)
similarly, enable the Ctrl+Alt+Del in runlevel 3 only
Edit /etc/inittab to add a new login prompt on
tty9.
Use dmesg to read the chipset of your ethernet card.
Investigate differences between shutdown, halt and reboot.
- Which option to shutdown will force an fsck at the next boot?
Use the tools chkconfig or ntsysv to disable the sshd daemon in runlevel 2,3,4, and 5
Verify that the symbolic links in the rc2.d,
rc3.d, rc4.d and
rc5.d directories have changed.
Reboot the system. At the boot prompt give the appropriate
init= parameter to skip
/sbin/init and start a simple
bash session.