Linux Administration/System Architecture/Boot Configuration

This lesson covers boot configuration.

Objectives and Skills edit

Objectives and skills for the boot sequence portion of Linux+ certification include:[1]

  • Change runlevels/boot targets and shutdown or reboot system.
    • Set the default runlevel or boot target
    • Change between runlevels/boot targets including single user mode
    • Shut down and reboot from the command line
    • Alert users before switching runlevels/ boot targets or other major system events
    • Properly terminate processes
    • The following is a partial list of the used files, terms and utilities:
      • /etc/inittab
      • shutdown
      • init
      • /etc/init.d
      • telinit
      • system
      • systemctl
      • /etc/systemd/
      • /usr/lib/system/
      • wall

Readings edit

  1. Wikipedia: Runlevel
  2. Wikipedia: Shutdown (computing)
  3. Wikipedia: init
  4. systemd
  5. Wikipedia: Upstart (software)
  6. Wikipedia: wall (Unix)

Multimedia edit

  1. YouTube: Working with Linux Runlevels
  2. YouTube: Properly Terminating Linux Processes
  3. YouTube: Init, Systemd, and Upstart

Activities edit

  1. Complete the tutorial IBM: Learn Linux, 101: Runlevels, boot targets, shutdown, and reboot
  2. Shutdown
    • Use shutdown to shutdown the system.
    • Use telinit 0 to shutdown the system.
    • Use systemctl isolate poweroff.target to shutdown the system.
  3. Reboot
    • Use reboot to reboot the system.
    • Use telinit 6 to reboot the system.
    • Use systemctl isolate reboot.target to reboot the system.
    • Use telinit 1 to reboot the system in single-user mode.
    • Use systemctl isolate rescue.target to reboot the system in single-user mode.
  4. Test the difference between halt and halt -p.
  5. Set default runlevels.
    • Use systemctl set-default multi-user.target to configure multi-user mode. Reboot.
    • Use systemctl set-default graphical.target to configure graphical user mode. Reboot.
  6. Review HowToForge: Linux wall Command Tutorial. Use wall to alert users of an impending reboot.
  7. Use kill to stop processes.
    • Review Benjamin Cane: Understanding the kill command, and how to terminate processes in Linux.
    • Run a user program, such as the calculator or an editor. Use ps -A to find the program's process ID. Use kill and the process ID to ask the program to terminate itself.
    • Run the program. Use ps -A to find the program's process ID. Use kill -15 and the process ID to ask the program to terminate itself.
    • Run the program. Use ps -A to find the program's process ID. Use kill -SIGTERM and the process ID to ask the program to terminate itself.
    • Run the program. Use ps -A to find the program's process ID. Use kill -9 and the process ID to kill the process.
    • Run the program. Use ps -A to find the program's process ID. Use kill -SIGKILL and the process ID to kill the process.
  8. Stop and restart services.
  9. Review CyberCiti.biz: Service command.
    • Use service --status-all to list service status.
    • Use service cups stop to stop the printing service.
    • Use service cups start to start the printing service.
    • Use service cups restart to restart the printing service.

Lesson Summary edit

  • The halt command will halt, poweroff, or reboot the system:[2]
    • halt command stops CPU processing
    • halt -p stops CPU processing and powers off a system
    • halt --reboot reboots a system
  • The kill command is used to terminate processes without having to log out or reboot the computer.[3]
    • kill <pid> (SIGTERM, option 15) and signals the process to terminate itself
    • kill -9 <pid> or kill -SIGKILL <pid> kills the process
  • The service command is used to start, stop, and restart services.[4]
  • The shutdown command turns off or reboots a computer.[5]
    • shutdown -h now shuts down a system immediately
    • shutdown -r now reboots a system
  • The systemctl command is used to examine and control the state of "systemd".[6]
    • systemctl isolate <target> changes the runlevel[7]
    • systemctl set-default <target> sets the default runlevel[8]
  • systemctl runlevels include:[9]
    • 0 - poweroff.target
    • 1 - rescue.target
    • 3 - multi-user.target
    • 5 - graphical.target
    • 6 - reboot.target
  • The telinit command signals init to change runlevels. Runlevels include:[10]
    • 0 - halt
    • 1 - single-user mode
    • 6 - reboot
  • The wall command (write to all) displays the contents of a file or standard input to all logged-in users.[11]
  • /etc/init.d contains start/stop scripts for system services.[12]
  • /etc/inittab is the top-level configuration file for init.[13]
  • /etc/systemd/ contains local systemd configuration files.[14]

Key Terms edit

See Also edit

References edit