|
Practical Exercises with run levels
The exercises below should be done on run01 VM.
Switching between run levels.
Create /etc/inittab with the following entries
to boot into default Run Level 5;
reboot the system using /sbin/init 6 command.
When the system boots up, verify the current run level
with command
Change sequentially to Run Levels 3, 2, and 1 using command
where N is the next Run Level.
Run /sbin/runlevel command in every Run Level.
Creating startup scripts.
Copy the script from the lecture, sample.sh, in /etc/init.d directory;
make it executable; try to run it:
Create symbolic links of the script to various /etc/rcN.d directories:
Init to Run Levels 1, 2, and 3 and notice if the init
runs S01sample and K99sample scripts: check the updated content
of file /var/log/sample.log
Remove the links.
Set the script to "stop" at run level 1, 3, and 5 and "start" at Run Levels 2 and 4:
Check what kind of links with sample.sh have been created in /etc/rc1.d
/etc/rc2.d, /etc/rc3.d, /etc/rc4.d and /etc/rc5.d
Remove the log file
Enter Run Levels 1, 2, 3, 4, and 5. Check the content of file
/var/log/sample.log.
|
|