Content #
systemd unit files Service Units(systemd) unclean kill signal Masking a service Create a new container service with podman from user account systemd timers Changing the default locale Setting time and timezone parameters Shutdown and Reboot(systemd) The four default slices 需要执行daemon-reload的情形
自定义服务应当放在/etc/systemd/system目录下,放在/lib/systemd/system下的服务文件会被系统更新时覆盖。
user@.service文件中的@符号表示这是service template,配置文件中的"%i"会被替换为@后的参数。
systemd starts loading the bootup targets in the following order:
- local-fs-pre.target
- local-fs.target
- sysinit.target
- basic.target
- multi-user.target
- graphical.target
Within each target, processes start up in parallel.
systemd生成的unit文件位置:
/run/systemd/generator
Setting the hostname and machine information #
hostnamectl
sudo hostnamectl set-hostname "Donnie's Computer"
Get Help #
man systemd-system.conf
apropos systemd
man -k systemd
man systemd.unit
man systemd.directives #配置指令文档
man systemd.exec #Execution environment configuration
systemctl -h # quick reference
systemctl --state=help #see a list of all of the different states
systemctl show #show running configuration
systemctl show --property=DefaultLimitSIGPENDING