Introduction to UNIX: 
Exercise Sheet Seven

N.B. Please take extra care when using the root account. Since your commands will be carried out without the safeguards that apply to ordinary users, you may do serious damage to the system. If in doubt, please ask (preferably before pressing !)
  1. Use su - to become root.
  2. Add a new user of your choosing to the system. Set their password. Check that they can log in.
  3. Add a new user group of your choosing to the system. Place yourself (i.e. your login, not root), and the user that you have added in the group. Check that you are both in the new group.
  4. Remove the user that you added.
  5. Go to /usr/src/linux. Type "make menuconfig". Investigate the range of kernel module choices on offer.
  6. Proceed with attempting to compile the kernel as described in the notes up to the "make modules" statement. Do not proceed past this point. Where is your new kernel image? How would you (theoretically) proceed to install it?
  7. Make yourself a cron job that sends you a message (using write) every 10 minutes. Remove this when you start to find it irritating.
  8. Discover how to restart the web server httpd (or any other system daemon).
  9. tinyhttpd.pl in ~will  is a mini-web server written in Perl. Switch back to being a normal user, and make a copy of tinyhttpd.pl in your home directory. Change the port number on which it operates to a port of your choice (currently 8080, but use a different one that noone else will be using). Create a public_html directory in your home directory and create a home page file inside it called "index.html". Now run tinyhttpd.pl in the background and use telnet (telnet lumberjack port, where port is the port number, and then issue the HTTP command GET / HTTP/1.0) or a web browser (call up http://lumberjack:port) to test that your home page file is in fact being served.
  10. Switch back to being root. Add a line to /etc/inittab which will ensure that your mini web-server will respawn itself if it dies. Kill your web server (using kill) and see if the respawning works (init re-examines the /etc/inittab file whenever one of its descendant processes dies so you should not have long to wait for this to take effect). It may be helpful to monitor the system messages file with tail -f /var/log/messages.

© December 2000 William Knottenbelt (wjk@doc.ic.ac.uk)