1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 # This file is part of systemd.
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
11 Description=Journal Service
12 Documentation=man:systemd-journald.service(8) man:journald.conf(5)
13 DefaultDependencies=no
14 Requires=systemd-journald.socket
15 After=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket syslog.socket
18 # To avoid journald SIGKILLed during soft-reboot and corrupting journals.
19 # See https://github.com/systemd/systemd/issues/30195
20 # Note, typically soft-reboot.target will be never reached,
21 # and systemd-soft-reboot.service will trigger soft-reboot.
22 # Hence, this must be stopped before systemd-soft-reboot.service.
23 Before=soft-reboot.target systemd-soft-reboot.service
24 Conflicts=soft-reboot.target
26 # Mount and swap units need the journal socket units. If they were removed by
27 # an isolate request the mount and swap units would be removed too, hence let's
28 # exclude systemd-journald and its sockets from isolate requests.
33 ExecStart={{LIBEXECDIR}}/systemd-journald
34 FileDescriptorStoreMax=4224
35 # Ensure services using StandardOutput=journal do not break when journald is stopped
36 FileDescriptorStorePreserve=yes
37 ImportCredential=journal.*
40 MemoryDenyWriteExecute=yes
46 RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_VSOCK AF_INET AF_INET6
47 RestrictNamespaces=yes
50 RuntimeDirectory=systemd/journal
51 RuntimeDirectoryPreserve=yes
52 # Audit socket is not listed here because this unit can be turned off. However
53 # the link between the socket and the service units is still created thanks to
54 # the 'Service=' setting specified in the socket unit.
55 Sockets=systemd-journald.socket systemd-journald-dev-log.socket
57 SystemCallArchitectures=native
58 SystemCallErrorNumber=EPERM
59 SystemCallFilter=@system-service
64 # In case you're wondering why CAP_SYS_PTRACE is needed, access to
65 # /proc/<pid>/exe requires this capability. Thus if this capability is missing
66 # the _EXE=/OBJECT_EXE= fields will be missing from the journal entries.
67 CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_SYSLOG CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID CAP_MAC_OVERRIDE
69 # If there are many split up journal files we need a lot of fds to access them
71 LimitNOFILE={{HIGH_RLIMIT_NOFILE}}