Systemd tips and tricks: Difference between revisions
Jump to navigation
Jump to search
m (Admin moved page Systemd tips and trick to Systemd tips and tricks without leaving a redirect) |
No edit summary |
||
Line 1: | Line 1: | ||
=== Ensure the mount path is accessible before the service | == How to read live-tail logs of multiple services with journalctl == | ||
#Systemd - How to read live-tail logs of multiple services with journalctl | |||
$<ref>https://gist.github.com/MrAndrewMal/764e69e35cef7e7b38f05e561d670c9f</ref>sudo journalctl --follow _SYSTEMD_UNIT=docker.service + _SYSTEMD_UNIT=apache2.service | |||
== Ensure the mount path is accessible before the service == | |||
<code>[Unit] | <code>[Unit] | ||
RequiresMountsFor=<path required></code> | RequiresMountsFor=<path required></code> | ||
This will ensure the path is accessible before starting the service and also will mount it if it's not already (unless it has noauto specified). | This will ensure the path is accessible before starting the service and also will mount it if it's not already (unless it has noauto specified). | ||
== Reference == | |||
<references /> |
Revision as of 10:25, 14 June 2023
How to read live-tail logs of multiple services with journalctl
#Systemd - How to read live-tail logs of multiple services with journalctl $[1]sudo journalctl --follow _SYSTEMD_UNIT=docker.service + _SYSTEMD_UNIT=apache2.service
Ensure the mount path is accessible before the service
[Unit]
RequiresMountsFor=<path required>
This will ensure the path is accessible before starting the service and also will mount it if it's not already (unless it has noauto specified).