LINUX: 4.3.7 Practice Questions
You have a systemd Linux system that is configured to boot into the graphical.target by default. The system seems to be running much slower than normal. You need to reboot the system, but you want it to boot into a single-user target unit with no network access so you can perform troubleshooting tasks and get the system running normally again. What should you do before you reboot?
Set the default boot target torescue.target. In this case, you should configure the default boot target to rescue.target. The rescue.target unit runs in single-user mode and does not support networking. You make this the default boot target by entering systemctl set-default rescue.target. The /etc/inittab is no longer used to configure how the system boots. Use the CMOS settings to specify the boot sector containing the Master Boot Record (MBR).
You are working on a Linux distribution that uses systemd. Which non-symlink file in the /usr/lib/systemd/system/ directory is used to start the services necessary for multiple users, networking, and a graphical display?
graphical.target The /usr/lib/systemd/system/graphical.target file is used to start the services necessary for multiple users, networking, and a graphical display on a system running systemd. The multi-user.target file in the /usr/lib/systemd/system/ directory is used to start the services necessary for multiple users and networking, but not for a graphical display, on a system running systemd. The default.target file is in the /etc/systemd/system directory and is a symlink to the target file in the /usr/lib/systemd/system/ directory, which is the default boot target. The rc-sysinit.conf file is used to set the default runlevel on a system running Upstart. The runlevel5.target file is a symlink to the graphical.target file.
You are experiencing a problem with one particular server. Each time it boots, it goes into single-user mode even though no warnings or errors are reported. You want to verify that it is configured to boot to the multi-user.target unit, just as all your other servers are. This system is running systemd. Which command would you use to see which boot target is set as the default?
systemctl get-default To see which boot target is currently set as the default target, enter systemctl get-default. The set-default option is used to set the default boot target. The isolate option is used to change from the current target unit to another target unit.
You are experiencing a problem with a network server. You want to bring the system down and try reseating the cards within it before restarting it. Which command runs poweroff.target to shut down the system in an orderly manner?
systemctl isolate poweroff.target On a systemd Linux system, you can run the poweroff.target with any of the following commands: systemctl isolate poweroff.target systemctl isolate poweroff systemctl poweroff poweroff
The current default boot target is a multi-user.target, but you want to use this system as a desktop workstation. You need a boot target that supports multiple users, supports networking, and has a graphical display. This is a systemd system. What command should you enter to change the default boot target to one that meets these needs?
systemctl set-default graphical.target The command systemctl isolate graphical.target changes the target unit to one that supports multiple users, networking, and a graphical interface.
You are on a systemd system. Without rebooting the system, you want to change from the currently running target unit to a target that supports networking, supports multiple users, and displays a graphical interface. What command should you enter to accomplish this tak?
systemctl isolate graphical.target The command systemctl isolate graphical.target changes the target unit to one that supports multiple users, supports networking, and displays a graphical interface.
You need to perform some system maintenance on a systemd system, and you want to prevent users from logging on while you do so. Which command should you run?
systemctl isolate rescue.target Run systemctl isolate rescue.target to put the system into single-user mode and prevent additional logins. init 1 and runlevel0 are commands used on SysV init systems. There is no maint.target.
If a systemd system is configured to use multi-user.target as the default boot target, which file has a symbolic link (symlink) to the multi-user.target file?
/etc/systemd/system/default.target The default boot target is configured by creating a symbolic link, or symlink, from the /etc/systemd/system/default.target file to the desired target file. The target files are all found in the /usr/lib/systemd/system directory. For example, when you enter the command systemctl set-default graphical.target, the system creates a symlink from the /etc/systemd/system/default.target file to the /usr/lib/systemd/system/graphical.target file.
Which of the following systemd unit-specific sections describes how to manage services or applications on the server?
Service Service describes how to manage a service or application on the server.Socket describes a network or IPC socket or a FIFO buffer that systemd uses for socket-based activation.Mount defines a mountpoint on the system to be managed by systemd.Automount configures a mountpoint that will be automatically mounted
Which of the following is responsible for bringing up other units and services when boot targets are changed?
systemd The systemd daemon is the first daemon to start during boot-up and the last one to terminate during a system shutdown. systemd manages all daemons, processes, targets, and services (including itself) as units. Each target is defined by specific units, and systemd monitors the start and stop of each unit for each target. The init daemon serves a similar purpose on SysV init systems, but init manages services for runlevels. The terms unit and target are used with systemd systems. The systemctl command is used on systemd systems to manage processes and change target units. The service command is used to manage processes on SysV init systems.