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/10/10 14:59] (current) – [Commands] 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 38: | Line 40: | ||
| systemctl list-units --type=mount | systemctl list-units --type=mount | ||
| systemctl stop ufw.service | systemctl stop ufw.service | ||
| + | systemctl --failed | ||
| | | ||
| ==== Set Runlevel ==== | ==== Set Runlevel ==== | ||
| Line 51: | Line 54: | ||
| 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 72: | ||
| 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 135: | ||
| < | < | ||
| [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 237: | ||
| to service unit! | to service unit! | ||
| - | ===Targets=== | + | ====systemd targets==== |
| multi-user.target | multi-user.target | ||