units/systemd-journalctl@.service: run with DynamicUser=yes

Follow-up for a109189fab

This follows the existing practice for
systemd-journal-{upload,gatewayd}.service,
as I think allocating a full-blown user
specifically for this purpose is an overkill.
And with DynamicUser=yes we can also take
advantage of implied sandboxing.
This commit is contained in:
Mike Yuan
2026-02-23 10:21:56 +01:00
parent 2619656950
commit 2afe8e28f8
4 changed files with 4 additions and 6 deletions
-1
View File
@@ -895,7 +895,6 @@ foreach option : ['adm-gid',
'video-gid', 'video-gid',
'wheel-gid', 'wheel-gid',
'systemd-journal-gid', 'systemd-journal-gid',
'systemd-journal-uid',
'systemd-network-uid', 'systemd-network-uid',
'systemd-resolve-uid', 'systemd-resolve-uid',
'systemd-timesync-uid'] 'systemd-timesync-uid']
-2
View File
@@ -328,8 +328,6 @@ option('wheel-gid', type : 'integer', value : 0,
description : 'soft-static allocation for the "wheel" group') description : 'soft-static allocation for the "wheel" group')
option('systemd-journal-gid', type : 'integer', value : 0, option('systemd-journal-gid', type : 'integer', value : 0,
description : 'soft-static allocation for the systemd-journal group') description : 'soft-static allocation for the systemd-journal group')
option('systemd-journal-uid', type : 'integer', value : 0,
description : 'soft-static allocation for the systemd-journal user')
option('systemd-network-uid', type : 'integer', value : 0, option('systemd-network-uid', type : 'integer', value : 0,
description : 'soft-static allocation for the systemd-network user') description : 'soft-static allocation for the systemd-network user')
option('systemd-resolve-uid', type : 'integer', value : 0, option('systemd-resolve-uid', type : 'integer', value : 0,
+1 -2
View File
@@ -5,5 +5,4 @@
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version. # (at your option) any later version.
g systemd-journal {{SYSTEMD_JOURNAL_GID}} - g systemd-journal {{SYSTEMD_JOURNAL_GID}} -
u! systemd-journal {{SYSTEMD_JOURNAL_UID}} "systemd Journal"
+3 -1
View File
@@ -17,4 +17,6 @@ RequiresMountsFor=/var/log/journal
[Service] [Service]
ExecStart=journalctl ExecStart=journalctl
User=systemd-journal DynamicUser=yes
User=systemd-journal-access
SupplementaryGroups=systemd-journal