=================== Exercise #4 answers =================== 1) Show the updated "initdefault" line from your /etc/inittab file. id:3:initdefault: 2) Show the updated "tty1" line from your /etc/inittab file. 1:2345:respawn:/sbin/mingetty --noclear tty1 3) What command line tells "init" to re-read the /etc/inittab file? telinit q 4) What is the documented meaning of each of the Mandriva (Mandrakelinux) run levels? 0 - halt (Do NOT set initdefault to this) 1 - Single user mode 2 - Multiuser, without NFS (The same as 3, if you do not have networking) 3 - Full multiuser mode 4 - unused 5 - X11 6 - reboot (Do NOT set initdefault to this) 5) What would happen if you set the "initdefault" run level to 0? (It is not recommended to do this.) When the system next starts to boot it would halt. 6) What would happen if you set the "initdefault" run level to 6? (It is not recommended to do this.) When the system next reboots, it would reboot over and over. 7) What is the full pathname of the script file used during "System initialization", and how many lines does it contain? /etc/rc.d/rc.sysinit 1247 8) Describe exactly what will happen to your server if you press CTRL-ALT-DEL. (Describe it, in detail; don't do it!) Give the meanings of all options used by any related commands. From this line in the inittab: ca::ctrlaltdel:/sbin/shutdown -t3 -r now we see that /sbin/shutdown will run causing the system to shut down. -t3: wait 3 seconds between sending warning and kill signals -r: reboot after shutdown now: shut down immediately 9) The program "/bin/true" executes and does nothing. (Try it!) How could you use this program to make your server ignore CTRL-ALT-DEL? Show the updated line in /etc/inittab that would do this. Do not actually update /etc/inittab - only display what might be done. Replace the line with: ca::ctrlaltdel:/bin/true 10) True/False - the NTP program will refuse to set the time on a system if the time is more than 1000 seconds wrong. (ALN p.244) True 11) What program can you use to manually set the system clock before calling the NTP program? (ALN p.244) ntpdate 12) What option to the above program causes it to execute, go through all the steps, but not actually set the time? (RTFM) Give an example command line using the time server pool.ntp.org as the target. Include the output of the command line. ntpdate -d pool.ntp.org 13 Feb 16:38:23 ntpdate[8634]: ntpdate 4.2.0@1.1161-r Tue Aug 30 18:01:52 MDT 2005 (1) Looking for host pool.ntp.org and service ntp host found : customer-reverse-entry.64.151.120.244 transmit(64.151.120.244) receive(64.151.120.244) transmit(64.151.120.244) receive(64.151.120.244) transmit(64.151.120.244) receive(64.151.120.244) transmit(64.151.120.244) receive(64.151.120.244) transmit(64.151.120.244) server 64.151.120.244, port 123 stratum 2, precision -18, leap 00, trust 000 refid [64.151.120.244], delay 0.12021, dispersion 0.00023 transmitted 4, in filter 4 reference time: c79b768b.f439f89a Mon, Feb 13 2006 16:20:11.954 originate timestamp: c79b7ad1.647d3328 Mon, Feb 13 2006 16:38:25.392 transmit timestamp: c79b7ad1.5921144c Mon, Feb 13 2006 16:38:25.348 filter delay: 0.12195 0.12021 0.12025 0.12134 0.00000 0.00000 0.00000 0.00000 filter offset: -0.00234 -0.00314 -0.00306 -0.00351 0.000000 0.000000 0.000000 0.000000 delay 0.12021, dispersion 0.00023 offset -0.003147 13 Feb 16:38:25 ntpdate[8634]: adjust time server 64.151.120.244 offset -0.003147 sec 13) If you know the name of a program or file (e.g. ntpd), how do you find out which Mandriva packages contain this program? Give an example command line using the string "ntpd" as the file for which to search. (Use a command that searches for strings in packages even if the packages are not installed on your system currently.) Include the output of the command line. urpmf /ntpd ntp-client:/usr/sbin/ntpdate ntp-client:/usr/share/man/man1/ntpdate.1.bz2 ntp:/etc/rc.d/init.d/ntpd ntp:/usr/sbin/ntpd ntp:/usr/sbin/ntpdc ntp:/usr/share/doc/ntp-4.2.0/html/ntpd.html ntp:/usr/share/doc/ntp-4.2.0/html/ntpd.html.droproot ntp:/usr/share/doc/ntp-4.2.0/html/ntpdate.html ntp:/usr/share/doc/ntp-4.2.0/html/ntpdc.html ntp:/usr/share/doc/ntp-4.2.0/html/ntpdsim.html ntp:/usr/share/man/man1/ntpd.1.bz2 ntp:/usr/share/man/man1/ntpdc.1.bz2 14) What version of the NTP package is installed? Give the command line that will display the full Mandriva package name and version information. (Use a command that tells you information about installed packages.) Include the output of the command line. rpm -q ntp ntp-4.2.0-18.1.102mdk 15) How do you display the information description for the installed NTP package? Give a command line that will display this information. rpm -qi ntp 16) Give a command line that will discover in which Mandriva package the executable ntpdate program actually resides. (System executable programs usually reside in /sbin or /usr/sbin.) Include the output of the command line. urpmf /ntpdate ntp-client:/usr/sbin/ntpdate ntp-client:/usr/share/man/man1/ntpdate.1.bz2 ntp:/usr/share/doc/ntp-4.2.0/html/ntpdate.html 17) Give a command line that will show the full Mandriva package name and version information for the installed package that actually contains ntpdate. Include the output of the command line. rpm -q ntp-client ntp-client-4.2.0-18.1.102mdk 18) By looking in the names of the files installed by the NTP package, give a command pipeline that shows just the pathname of the NTP start-up script that resides under the init.d directory. (Hint: Produce a list of all the names in the installed NTP package and pipe that into a command that searches for the "init.d" string. The resulting absolute pathname is the name of the NTP start-up script.) rpm -ql ntp | grep init.d /etc/rc.d/init.d/ntpd 19) Does the NTP start up script call the ntpdate program? Give a command line that searches for the string "ntpdate" in this file. Include the output of the command line. grep ntpdate /etc/rc.d/init.d/ntpd /usr/sbin/ntpdate -s -b -p 8 -u `cat /etc/ntp/step-tickers` 20) What absolute pathname does the ntpdate program use to get its list of time servers? (Reference the output of the previous question.) Show a long listing of this file (including the size and modify time). /etc/ntp/step-tickers -rw-r--r-- 1 root root 0 Feb 3 12:34 /etc/ntp/step-tickers