wiki/notebook/linux.systemd.org
2022-11-23 17:57:59 +08:00

3.9 KiB

systemd

systemd is a big tool for a big system. Let's explore some of them from a perspective of a wannabe power user.

Among other things, it has the following list of features.

systemd at user-level

systemd has the ability to run at user-level empowering the user to manage their own system with their own settings. It immensely helps separating user-specific settings from the system-wide settings.

systemd looks for the units from certain paths. You can look for them from the systemd.unit.5 manual page.

To run systemd as a user instance, simply add a --user flag beforehand for systemctl and other systemd binaries, if applicable.

# See how different the output when run at user- and system-level.
systemctl --user show-units
systemctl show-units

systemctl --user show-environment
systemctl show-environment

systemctl --user start $SERVICE

Navigating systemd documentation

Because of the wide scope of the tool, it is best to know where you can find certain information. Here's an exhaustive list of the locations.

  • Most sensible distributions should include the manual pages from the software. systemd has a lot of them from knowing systemd timers at systemd.timers.5, the unit formats and their locations at systemd.unit.5.
  • systemd.directives.7 is an index of configuration directives including unit keys, environment variables, and command line options for systemd-related things. Also contains the related manual pages for a deeper references. 1
  • On a similar note, systemd.index.7 is an alphabetical index of the important keywords found in systemd.

Extra information

  • systemd.mount units require the filename to be the mountpoint. Though, it has to be converted to what systemd accepts (e.g., systemd-escape --path $PATH).
  • systemd has a few usual units such as default.target which is a target for the current environment of the user. It can be get with systemctl get-default command. More can be seen with systemd.special.7 from the manual.
  • Not all units are equal as systemd treats some units specially. You can see what these specific units are and what it does with systemd.special.7 from the manual.

1

How did I pass a year without knowing this?