Table of Contents

Boot Up/Shut Down, Services




Some Review

Who, What, Where?

        $ whoami

        $ w

        $ who

        $ finger (if system configured for it)
        $ uname -a          # What OS is this? For what architecture? What kernel version?

        $ cat /proc/cpuinfo # What CPU(s)?

        $ dmesg             # Hardware & driver information

        $ cat /etc/fedora-release
        $ cat /etc/debian_version
        # What version of a Linux distribution is this? redhat, fedora, debian, etc?
         $ uname -n         # Which host am I logged into?

         $ cat /etc/hosts   # Local map of what IP addresses are mapped to what hostnames

         $ cat /etc/hostname*   # local hostname; may differ from hostname on domain name server
         $ hostname

         $ cat /etc/dhcp/dhclient*   # may contain hostname request to domain name server

         $ /sbin/ifconfig       # What's my IP address?
         C:\> ipconfig          # Windows
         
         $ ip addr              # ifconfig considered deprecated; use ip instead

         $ host <ip address from ifconfig output> # What's my hostname on the name server?
         $ nslookup <ip address from ifconfig output>

         $ pwd                  # present working directory

Setting shell prompts to reduce the confusion

         jchung@rockhopper:/usr/local$        # Tells me who, where & what

OS Boot Up

Boot Phases

BIOS / Bootloader

Runlevels (UNIX)

   cslab00: /export/home/uf/jchung $
   who -r
      .       run-level 3  Jan 21 14:50     3      0  S

   jchung@rockhopper:~$ who -r
      run-level 5  2009-01-07 00:10                   last=3



   Default run level defined in /etc/inittab on Sys V / Linux:

   Table - System V Run Levels
   -------------------------------------------------------------------------------------------
   Run Level  Names and Uses
   -------------------------------------------------------------------------------------------
   0          Powerdown state; conditions where it is safe to turn the power off.
   1          Administrative state.
   s or S     Single-user mode.
   2          Multi-user mode; Normal operating state for isolated,
              non-networked systems.
   3          Remote File Sharing (RFS) state. Alternative state for networking use. (Normal
              multi-user state for OSF/1; other Sys V may use state 2).
   4          User-definable state. (Also not normally used; state 2 used instead).
   5          Firmware state; Used for some types of maintenance on some systems.
   6          Shutdown and reboot state; used to reboot the system from some other running
              state (s, 2, 3 or 4) to state 0 then immediately back to normal operating state.
   -------------------------------------------------------------------------------------------

Initialization scripts (UNIX)



Shut Down and Reboot

When rebooting necessary

             # shutdown -t 300 "Shutting down for weekly backups in 5 minutes..."
             # shutdown now "There's water coming through the ceiling. Shutting down now."

System crashes, possible causes

Non-booting system, possible causes



Services

Review of Processes


Daemons and Services


Lab Activity (DO NOT DO UNTIL INSTRUCTED)

  1. Install package upgrades on your virtual Linux system(s).
    • Create a root cron job to download package upgrades nightly.
  2. Install ntp and keep your system time in sync with clock.monmouth.edu.
    • ntp may already have been installed.
    • Run date on your Linux lab host (csselin02-csselin13) and also on your virtual Linux systems. Are the dates/times significantly different?
    • Install the package ntp using apt-get install ntp
    • ntp is now a new service on your Linux systems.
    • What init script has been added to /etc/init.d for ntp?
    • How can you tell that the ntp package has been installed?
    • How can you tell that the ntp service is running?
    • How can you tell that the ntp service is set to start at system boot up and set to stop at system shutdown/reboot?