==================== Lab 7 sample answers ==================== - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Copy all the numbered questions labelled "ANSWER:" below into the lab07answers.txt file and, below each question, give your command line and answer to the question in the file. For full marks, whenever you are asked for the output of a command, include the command that generated the output in your answer as well. Always include the command lines along with the output of the commands. 15) What file name contains the default run level for Linux? ANSWER: /etc/inittab 16) What run level does this "White" UML machine default to at boot? Give a command line that selects and displays the line containing the default run level from the associated file, along with its output. ANSWER: # grep initdefault /etc/inittab id:2:initdefault: 17) Note that the "White" UML machine delays for 10 seconds during the boot. Locate the associated start-up script symbolic link located in the start-up directory of the current Linux run level for the "White" UML machine. Show a long listing of the absolute path to the delay start-up script symlink (not to the script itself). (The symlink is the only entry in the whole run level directory; it is dated 2006-01-10 09:10) ANSWER: # ls -l /etc/rc2.d/* lrwxrwxrwx 1 root root 15 2006-01-10 09:10 S99delay -> ../init.d/delay 18) Show a long listing of the absolute path to the delay start-up script itself (to the actual script, the target of the symlink, not to the symlink). (The real file is dated 2005-03-08 21:29.) ANSWER: # ls -l /etc/init.d/delay -rwxr-xr-x 1 root root 407 2005-03-08 21:29 /etc/init.d/delay 19) Remove the delay symlink from this run level of the "White" UML machine using an absolute pathname to the symlink. (Only remove the symlink; don't remove the actual script!) Give the command line, including the absolute pathname of the symbolic link you removed: ANSWER: rm /etc/rc2.d/S99delay 20) Reboot your "White" UML machine (not your host VNS!) using the console command "shutdown -r now". Make sure the "White" UML machine reboots without the 10 second delay. How long does a UML shutdown and reboot take? ANSWER: varies, e.g. 40 sec 21) VNS is Knoppix-based, which is a Debian-based Linux system. In which Debian directory does your text say we put "Local startup scripts" that will run at boot time? (ALN Table 4.1 p.81) ANSWER: /etc/rc.boot 22) Which control script in /etc/init.d/ is responsible for running the executable scripts in the above directory? (Look for the above directory name in all the scripts. It appears on two lines in one script. The script name should match the name of the Debian "Startup control script" in ALN Table 4.1 p.81). In other words: In /etc/init.d/ there is one special script that is responsible for running all the boot-time start-up scripts and for running the "Local startup scripts". First, find the Debian name of the directory containing the "Local startup scripts". (You just did this in the previous question.) Look for that local startup script directory name in all the scripts under /etc/init.d/* in your White UML machine. You will find only one file that mentions this directory, on two comment lines. Give the command you used to find the name in all the init.d scripts, along with the two lines of output of the command: ANSWER: # grep rc.boot /etc/init.d/* rcS:# For compatibility, run the files in /etc/rc.boot too. rcS:#[ -d /etc/rc.boot ] && run-parts /etc/rc.boot 23) You will note that the two lines of script comments that you find above in the White UML machine are commented out as being "for compatibility" - the UML machines do not use the old rc.boot method of running boot-time start-up scripts. The FOR loop above those two lines, in the same control script file, shows in which directory modern boot-time start-up scripts should be placed. (The comment at the top of the file also gives its name.) What is the name of the current boot-time start-up scripts directory, into which symbolic links are placed to each boot-time start-up script? Give a long listing of the contents of this directory (it contains a directory, a file, and three symlinks): ANSWER: # ls -l /etc/rcS.d/ drwxr-xr-x 2 root root 1024 2006-01-10 08:45 orig -rw-r--r-- 1 root root 701 1997-09-01 08:48 README lrwxrwxrwx 1 root root 18 2006-01-10 09:10 S00umlsetup -> ../init.d/umlsetup lrwxrwxrwx 1 root root 18 2006-01-10 09:10 S02umlcolor -> ../init.d/umlcolor lrwxrwxrwx 1 root root 20 2006-01-10 09:10 S40networking -> ../init.d/networking