This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:systemd [2020/04/24 22:09] – [Systemctl] tmade | linux:systemd [2024/01/24 00:25] (current) – [Service Units] tmade | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Systemctl ===== | ===== Systemctl ===== | ||
+ | |||
+ | ==== Commands ==== | ||
systemctl disable service | systemctl disable service | ||
Line 20: | Line 22: | ||
journalctl | journalctl | ||
journalctl -xe | journalctl -xe | ||
- | journalctl -u sshd -f # " | + | journalctl -u sshd -f # " |
journalctl -u kubelet.service | journalctl -u kubelet.service | ||
systemctl list-units --state=failed | systemctl list-units --state=failed | ||
Line 51: | Line 53: | ||
ln -sf / | ln -sf / | ||
- | ===== Service Units ===== | + | ==== Service Units ==== |
Service units are located on SLES12 in: | Service units are located on SLES12 in: | ||
Line 69: | Line 71: | ||
systemctl daemon-reload | systemctl daemon-reload | ||
| | ||
- | to make it active. | + | to update |
| | ||
**Warning: Always do systemd customization in "/ | **Warning: Always do systemd customization in "/ | ||
Line 132: | Line 134: | ||
< | < | ||
[Unit] | [Unit] | ||
- | Description=Load iptables | + | Description=iptables |
- | After=bind9.service | + | DefaultDependencies=no |
+ | Wants=network-pre.target systemd-modules-load.service local-fs.target | ||
+ | Before=network-pre.target shutdown.target | ||
+ | After=systemd-modules-load.service | ||
+ | Conflicts=shutdown.target | ||
[Service] | [Service] | ||
Type=oneshot | Type=oneshot | ||
RemainAfterExit=yes | RemainAfterExit=yes | ||
- | ExecStart=/ | + | # |
+ | ExecStart=/ | ||
+ | ExecStartPost=/ | ||
+ | ExecStartPost=/ | ||
+ | |||
+ | ExecStop=/ | ||
+ | ExecStop=/ | ||
+ | ExecStop=/ | ||
+ | ExecStop=/ | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
- | WantedBy=network-online.target | + | #WantedBy=network-online.target |
</ | </ | ||
Line 222: | Line 236: | ||
to service unit! | to service unit! | ||
- | ===Targets=== | + | ====systemd targets==== |
multi-user.target | multi-user.target |