Booting, Targets, Services Flashcards

1
Q

Where are targets located?

A

/etc/systemd/system *called first

/usr/lib/systemd/system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are ways to shutdown?

A
shutdown -h
shutdown -r
shutdown -P
shutdown +3 *3 minutes
*calls systemctl shutdown
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you find available targets on a system?

A

systemctl list-units –type=target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you find the different types of unit configuration files on a system?

A

systemctl -t help

*type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you find dependencies of a target?

A

systemctl list-dependencies

i.e systemctl list-dependencies multi-user.target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you get the default target?

A

systemctl get-default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the multi-user.target?

A

Multiple users can be logged into the system (generally command line)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the graphical.target?

A

GUI interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the emergency.target?

A

Boots into root user, mounts file system as read only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the rescue.target?

A

Boots into single user environment for troubleshooting system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a target?

A

A type of unit configuration file, grouping of dependencies for services, components
*another example is service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you change the target you are in?

A

systemctl isolate

i. e systemctl isolate multi-user.target
* target has to be configured to move in and out of it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Hoe do you set the default target at boot?

A

systemctl set-default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you change the target within GRUB?

A

e *edit the kernel configuration
on linux16-vmlinuz- line append: systemd.unit=
i.e systemd.unit=multi-user.target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How would you gain access to a system if the root password is forgotten?

A

Within GRUB e *edit the kernel configuration

on linux16-vmlinuz- line append: rd.break

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Once entered into initramfs how would you change a password?

A

mount -oremount,rw /sysroot *remount as read/write as it is currently write
chroot /sysroot *mount /sysroot as new root directory
passwd
touch /.autorelabel *SELinux relabels all files at next boot because the context of SELinux was changed
*contents of sysroot are to be mounted as root during final boot process

17
Q

How would you restart the network service?

A

systemctl restart network.service

18
Q

How do you check if a service is enabled?

A

systemctl is-enabled

i. e systemctl is-enabled sshd
* if .service is not specified it is assumed by default

19
Q

How do you view all disabled/enabled settings of all units?

A

systemctl list-unit-files –all

20
Q

How do you enable/disable a service?

A

systemctl enable {service}

systemctl disable {service}

21
Q

How do you start/stop a service?

A

systemctl start {service}

systemctl stop {service}