Linux Administration/System Architecture/Boot Configuration
This lesson covers boot configuration.
Objectives and Skills
editObjectives 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
editMultimedia
editActivities
edit- Complete the tutorial IBM: Learn Linux, 101: Runlevels, boot targets, shutdown, and reboot
- Shutdown
- Use
shutdown
to shutdown the system. - Use
telinit 0
to shutdown the system. - Use
systemctl isolate poweroff.target
to shutdown the system.
- Use
- 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.
- Use
- Test the difference between
halt
andhalt -p
. - 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.
- Use
- Review HowToForge: Linux wall Command Tutorial. Use
wall
to alert users of an impending reboot. - 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. Usekill
and the process ID to ask the program to terminate itself. - Run the program. Use
ps -A
to find the program's process ID. Usekill -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. Usekill -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. Usekill -9
and the process ID to kill the process. - Run the program. Use
ps -A
to find the program's process ID. Usekill -SIGKILL
and the process ID to kill the process.
- Stop and restart services.
- 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.
- Use
Lesson Summary
edit- The
halt
command will halt, poweroff, or reboot the system:[2]halt
command stops CPU processinghalt -p
stops CPU processing and powers off a systemhalt --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 itselfkill -9 <pid>
orkill -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 immediatelyshutdown -r now
reboots a system
- The
systemctl
command is used to examine and control the state of "systemd".[6] systemctl
runlevels include:[9]- 0 -
poweroff.target
- 1 -
rescue.target
- 3 -
multi-user.target
- 5 -
graphical.target
- 6 -
reboot.target
- 0 -
- The
telinit
command signalsinit
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
editSee Also
editReferences
edit- ↑ CompTIA: Linux+ Certification Exam Objectives - Exam LX0-103
- ↑ Geeks for Geeks: halt, poweroff and reboot Commands in Linux
- ↑ Linux Information Project: The kill Command
- ↑ ComputerHope: Linux service command
- ↑ Wikipedia: Shutdown (computing)
- ↑ Geeks for Geeks: systemctl in Unix
- ↑ SysTutorials: How to Change Systemd Boot Target on Linux
- ↑ SysTutorials: How to Change Systemd Boot Target on Linux
- ↑ TecMint: How to Change Runlevels (targets) in SystemD
- ↑ ComputerHope: Linux init and telinit commands
- ↑ Wikipedia: wall (Unix)
- ↑ GHacks: Get To Know Linux: The /etc/init.d Directory
- ↑ Wikipedia: Linux startup process
- ↑ Wikipedia: systemd