aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/cheat/systemd
blob: 4389bb6b7f20ae36c980169497731557400c588d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Display process startup time
systemd-analyze

# Display process startup time at service level
systemd-analyze blame

# List running units
systemctl list-units

# Load a unit at startup
systemctl enable foo.service

# Start or Stop a unit
systemctl <start | stop> foo.service

# Unit file locations
/etc/systemd/system
/usr/lib/systemd/system

# Manage service with battery status
ConditionACPower=

True is AC connecter and false if on battery.

# Modify unit file without altering upstring unit file
# Source: https://serverfault.com/questions/840996/modify-systemd-unit-file-without-altering-upstream-unit-file
Use commande `systemctl edit --full <unit>` for example
For `--user` : `systemctl edit --full <unit>`