Systemd (week 10) Flashcards
What is systemd?
Systemd is a system and service manager for linux (most common type)
what does systemd does on boot?
It starts as PID 1 and manages the services in userspace
What is a service(daemon)?
A service is a process that runs in the background without user input. Waits for events to occur and triggers something in response
What is a target?
group of services that are connected through dependencies and activate the required services to reach some sort of system state
What is the command to view current targets?
sudo systemctl list-units –type=target
How do you manage and control systemd?
systemctl
How do you get systemd to search for new or updated units?
systemctl daemon-reload
What’s the difference between masking a unit and disabling it?
Disable keeps the service from running on startup while masking will prevent the unit from starting at all
What’s the directory for custom service files?
/etc/systemd/system
What is the syntax of a servicefile?
[section]
directive=value
What directive runs a script in a unitfile?
ExecStart=dirpath
What are the common sections in a unit file?
[unit], [install], and a third depending on type ie [timer] for .timer or [service] for .service
What are the dependency directives?
requires(needs) and wants(option), can specify ‘after’ if run after a certain service
What is the advantage of using a package manager?
Installs packages with dependencies
How do you search for a package in archlinux
pacman -Ss
How do you delete a package?
pacman -Rns
What are software repositories?
Software repositories are where packages are kept for installation
How do you check which package repositories are enabled
/etc/pacman.conf
How to view all running timers?
systemctl list-timers
What are the two types of timers in systemd?
monotonic and Realtime
What is a monotonic timer?
Monotonic timer activates relative to a system event
ie OnBootSec
What is a Realtime timer?
A timer that activates based on a clock
ie OnCalender
How do you test if a realtime Oncalendar is working properly?
systemd-analyze calendar <calendar-format></calendar-format>
ie sudo systemd-analyze calendar --*
How do you change the timezone of your linux distro?
sudo timedatectl set-timezone <location></location>
What is the format of the OnCalendar directive?
DayOfWeek Year-Month-Day Hour:Minute:Second
ie Sat --* 05:00:00
What are the two main types of services?
simple (runs continuously) and oneshot (one and done)
Where is the mirrorlist for pacman?
/etc/pacman/pacman.d/mirrorlist
What repository does arch linux use?
Arch User Repository (AUR)