Systemd usage: Difference between revisions
From wikinotes
(→Logs) |
(→Logs) |
||
Line 38: | Line 38: | ||
= Logs = | = Logs = | ||
<blockquote> | <blockquote> | ||
See [[systemd journald]] | |||
</blockquote><!-- Logs --> | </blockquote><!-- Logs --> |
Revision as of 17:28, 11 December 2022
Documentation
man systemctl
https://man.archlinux.org/man/core/systemd/systemctl.1.en
Start/Stop
systemctl {list-units,list-timers,list-sockets} systemctl {enable,start,stop,restart} myservice systemctl {is-active,is-enabled} myservice systemctl show \ [-p property,...] `# list specific properties` \ [foo.service] `# filter to unitfile` \ # list filepaths for each service for service in $(systemctl list-units -t service,timer | head -n -6 | sed -n '2,$p' | sed -E 's/^[^a-zA-Z0-9]+//' | awk -F' ' '{ print $1 }'); do systemctl show -P Id,FragmentPath "$service" | sed 'N;s/\n/ /' done | column -t
Management
systemctl --system daemon-reload # reload unitfiles systemctl [--user] list-units -t target # list all targets
Logs
See systemd journald