Skip to content

eBPF-based security platform

systemd: set SyslogIdentifier for the shirudo services

John Fastabend7fcbb3d58949
diff --git a/Documentation/reference/systemd-units.rst b/Documentation/reference/systemd-units.rst
index 54e865d6..666eea2d 100644
--- a/Documentation/reference/systemd-units.rst
+++ b/Documentation/reference/systemd-units.rst
@@ -10,7 +10,9 @@ systemd units and timers
The units the target package installs, from ``systemd/*.in`` and
``systemd/*.timer``. Every service is ``Type=oneshot``: shirudo runs no
-daemon.
+daemon. Every service sets ``SyslogIdentifier=shirudo``, so what it writes
+to standard error reaches the journal under the same identifier as what
+it sends to syslog, whatever the name of the process that runs the binary.
Units
-----
diff --git a/systemd/shirudo-bpm-repo-update.service.in b/systemd/shirudo-bpm-repo-update.service.in
index 903da3a9..2071e1a1 100644
--- a/systemd/shirudo-bpm-repo-update.service.in
+++ b/systemd/shirudo-bpm-repo-update.service.in
@@ -9,6 +9,7 @@ RequiresMountsFor=/etc/shirudo/bpm /var/lib/shirudo
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
TimeoutStartSec=30min
EnvironmentFile=-/etc/shirudo/bpm/environment
diff --git a/systemd/shirudo-bpm-tree-sync.service.in b/systemd/shirudo-bpm-tree-sync.service.in
index 7a38854f..a4a877bb 100644
--- a/systemd/shirudo-bpm-tree-sync.service.in
+++ b/systemd/shirudo-bpm-tree-sync.service.in
@@ -9,6 +9,7 @@ RequiresMountsFor=/etc/shirudo/bpm /var/lib/shirudo
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
TimeoutStartSec=30min
EnvironmentFile=-/etc/shirudo/bpm/environment
diff --git a/systemd/shirudo-initrd.service.in b/systemd/shirudo-initrd.service.in
index 005f58b5..4dbc6ffa 100644
--- a/systemd/shirudo-initrd.service.in
+++ b/systemd/shirudo-initrd.service.in
@@ -31,6 +31,7 @@ RequiresMountsFor=/sysroot/var/lib/shirudo
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
RemainAfterExit=yes
KeyringMode=inherit
diff --git a/systemd/shirudo-keepalive.service.in b/systemd/shirudo-keepalive.service.in
index 9488b47c..e4a257ca 100644
--- a/systemd/shirudo-keepalive.service.in
+++ b/systemd/shirudo-keepalive.service.in
@@ -7,6 +7,7 @@ After=shirudo.service
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
TimeoutStartSec=2min
EnvironmentFile=-/etc/shirudo/map-export.env
diff --git a/systemd/shirudo-map-export.service.in b/systemd/shirudo-map-export.service.in
index e72a63d6..21b82c9e 100644
--- a/systemd/shirudo-map-export.service.in
+++ b/systemd/shirudo-map-export.service.in
@@ -8,6 +8,7 @@ ConditionPathExists=/run/shirudo/bpffs/lsm_link
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
TimeoutStartSec=5min
EnvironmentFile=-/etc/shirudo/map-export.env
diff --git a/systemd/shirudo-xdp-reconcile.service.in b/systemd/shirudo-xdp-reconcile.service.in
index 3c551fc2..975ca7d9 100644
--- a/systemd/shirudo-xdp-reconcile.service.in
+++ b/systemd/shirudo-xdp-reconcile.service.in
@@ -9,6 +9,7 @@ StartLimitIntervalSec=0
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
TimeoutStartSec=2min
ExecStart=@bindir@/shirudo upatch reconcile
diff --git a/systemd/shirudo.service.in b/systemd/shirudo.service.in
index 845baefd..53c0fe8b 100644
--- a/systemd/shirudo.service.in
+++ b/systemd/shirudo.service.in
@@ -25,6 +25,7 @@ ConditionPathIsMountPoint=/run/shirudo/runtime
[Service]
Type=oneshot
+SyslogIdentifier=shirudo
LimitMEMLOCK=infinity
RemainAfterExit=yes
KeyringMode=inherit