Service Management and Boot Troubleshooting Flashcards Preview

(RHCSA) Red Hat Certified System Administrator C > Service Management and Boot Troubleshooting > Flashcards

Flashcards in Service Management and Boot Troubleshooting Deck (25)
Loading flashcards...
1
Q

How can the status of a service be viewed with ‘systemctl’?

A

■ systemctl status .

2
Q

How are ‘systemd’ loaded units listed by type?

A

■ systemctl {–type=unittype}

■ systemctl list-units {–type=unittype}

3
Q

How can loaded units for ‘systemd’ be listed?

A

■ systemctl {–type=unittype}

■ systemctl list-units

4
Q

How can installed units for ‘systemd’ be listed?

A

■ systemctl list-unit-files {–type=unittype}

5
Q

How can a service be prevented from starting?

A

■ By masking the configuration directories used in starting the service.
■ systemctl mask network - prevent network command usage

6
Q

What is the difference between a disabled service vs. a masked service?

A

■ A disabled service will not be started automatically at boot or by other unit files, but can be started manually. A masked service can not be started manually or automatically.

7
Q

What ‘systemd’ target supports multiple users, graphical and text-based logins?

A

■ graphical.target

■ systemctl isolate graphical.target

8
Q

What ‘systemd’ target supports multiple users, text-based logins only?

A

■ multi-user.target

■ systemctl isolate multi-user.target

9
Q

What ‘systemd’ target presents ‘sulogin’ prompt and basic system initialization?

A

■ rescue.target

■ systemctl isolate rescue.target

10
Q

What ‘systemd’ target presents ‘sulogin’ prompt, initramfs pivot complete and system root mounted on / read-only?

A

■ emergency.target

■ systemctl isolate emergency.target

11
Q

How is the default ‘systemd’ target set?

A

■ systemctl set-default {target}

12
Q

How is the default ‘systemd’ target listed?

A

■ systemctl get-default {target}

13
Q

What steps are required to change the boot time ‘systemd’ target?

A
  1. Interrupt the boot loader menu countdown by pressing any key
  2. Move the cursor to the entry to be started
  3. Press ‘e’ to edit the current entry
  4. Move to the line that starts with ‘linux16’
  5. Append ‘systemd.unit={desired.target}’
  6. Press Ctrl+x to boot with these changes.
14
Q

What line must be edited with the ‘systemd’ target and how?

A

■ The line that starts with ‘linux16’

■ ‘systemd.unit={desired.target}’ must be appended to the end

15
Q

How are the different available of ‘systemd’ listed?

A

■ systemctl -t help

16
Q

What steps are required to change a lost root password?

A
  1. Interrupt the boot loader menu countdown by pressing any key
  2. Move the cursor to the entry to be started
  3. Press ‘e’ to edit the current entry
  4. Move to the line that starts with ‘linux16’
  5. Append ‘rd.break’
  6. Remount the file system as read-write
    mount -oremount,rw /sysroot
  7. Switch to chroot jail, where /sysroot is seen as root of the system tree
    chroot /sysroot
  8. Change the root password
    passwd root
  9. Set file system for relabeling
    touch /.autorelabel
  10. Exit twice, the reboot
17
Q

How is ‘journald’ logging made persistent?

A
  1. Make a directory to hold persistent logs
    ]# mkdir -p -m2775 /var/log/journal
  2. Change group ownership to ‘systemd-journal’
    ]# chown :systemd-journal /var/log/journal
  3. Tell ‘systemd-journald’ to reopen its logs
    ]# killall -USR1 systemd-journald
18
Q

How can logs from previous system boots be read?

A

■ journalctl -b-[number] -p [message level]
■ -b = boot logs
■ -[number] = boot ID
■ -p = message priority level
■ [message level] = (0)emerg,(1)alert,(2)crit,(3)err,(4)warning,(5)notice,(6)info,(7)debug
■ EX: journalctl -b-1 -p err

19
Q

What’s the difference between ‘emergency.target’ and ‘rescue.target’?

A

■ emergency.target keeps the root file system mounted read-only
■ rescue.target waits for ‘sysinit.target’ to complete first so that more of a system will be initialized

20
Q

How is the ‘early debug shell’ enabled?

A

■ systemctl enable debug-shell.service

■ Starts a root shell on TTY9 (Ctrl+Alt+F9). Root is automatically logged in; remember to disable it.

21
Q

What must be done after editing /etc/fstab?

A

■ Reload the systemd daemon

■ systemctl daemon-reload

22
Q

How is the emergency target used to fix boot problems?

A
  1. Interrupt the boot loader menu countdown by pressing any key
  2. Move the cursor to the entry to be started
  3. Press ‘e’ to edit the current entry
  4. Move to the line that starts with ‘linux16’
  5. Append ‘emergency’
  6. Press ‘Crtl+x’ to boot with these changes
  7. Enter root password
  8. Check if / file system is mounted read-only
  9. Diagnose problem from here
23
Q

What grub2 file should not be edited manually by administrators? What tool is used to edit it?

A

■ /boot/grub2/grub.cfg

■ grub2-mkconfig

24
Q

Where can the grub menu timeout and other options be set before running grub2-mkconfig?

A

■ /etc/default/grub

25
Q

What command reinstalls the boot loader?

A

■ grub2-install