2020-11-09 04:23:58 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2017-11-18 16:35:03 +00:00
|
|
|
#
|
2011-12-30 16:50:37 +00:00
|
|
|
# This file is part of systemd.
|
|
|
|
#
|
|
|
|
# systemd is free software; you can redistribute it and/or modify it
|
2012-04-11 22:20:58 +00:00
|
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
2011-12-30 16:50:37 +00:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Journal Service
|
2012-06-01 15:26:28 +00:00
|
|
|
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
|
2011-12-30 16:50:37 +00:00
|
|
|
DefaultDependencies=no
|
|
|
|
Requires=systemd-journald.socket
|
2014-11-03 19:58:24 +00:00
|
|
|
After=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket syslog.socket
|
2012-08-24 21:18:35 +00:00
|
|
|
Before=sysinit.target
|
2011-12-30 16:50:37 +00:00
|
|
|
|
2023-11-27 23:32:22 +00:00
|
|
|
# To avoid journald SIGKILLed during soft-reboot and corrupting journals.
|
|
|
|
# See https://github.com/systemd/systemd/issues/30195
|
|
|
|
Before=soft-reboot.target
|
|
|
|
Conflicts=soft-reboot.target
|
|
|
|
|
2022-06-29 11:14:37 +00:00
|
|
|
# Mount and swap units need the journal socket units. If they were removed by
|
|
|
|
# an isolate request the mount and swap units would be removed too, hence let's
|
|
|
|
# exclude systemd-journald and its sockets from isolate requests.
|
|
|
|
IgnoreOnIsolate=yes
|
|
|
|
|
2011-12-30 16:50:37 +00:00
|
|
|
[Service]
|
2019-05-01 12:28:36 +00:00
|
|
|
DeviceAllow=char-* rw
|
2023-06-12 01:15:19 +00:00
|
|
|
ExecStart={{LIBEXECDIR}}/systemd-journald
|
2017-07-17 08:04:37 +00:00
|
|
|
FileDescriptorStoreMax=4224
|
2023-12-21 15:32:15 +00:00
|
|
|
ImportCredential=journal.*
|
2018-11-12 16:19:48 +00:00
|
|
|
IPAddressDeny=any
|
|
|
|
LockPersonality=yes
|
2016-06-08 12:23:37 +00:00
|
|
|
MemoryDenyWriteExecute=yes
|
2018-11-12 16:19:48 +00:00
|
|
|
NoNewPrivileges=yes
|
2019-11-27 20:18:10 +00:00
|
|
|
OOMScoreAdjust=-250
|
2020-04-02 18:18:11 +00:00
|
|
|
ProtectClock=yes
|
2018-11-12 16:19:48 +00:00
|
|
|
Restart=always
|
|
|
|
RestartSec=0
|
2023-12-21 15:32:15 +00:00
|
|
|
RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_VSOCK AF_INET AF_INET6
|
2018-11-12 16:19:48 +00:00
|
|
|
RestrictNamespaces=yes
|
|
|
|
RestrictRealtime=yes
|
2019-03-20 18:52:20 +00:00
|
|
|
RestrictSUIDSGID=yes
|
2019-11-27 20:18:28 +00:00
|
|
|
RuntimeDirectory=systemd/journal
|
|
|
|
RuntimeDirectoryPreserve=yes
|
2022-12-06 19:15:43 +00:00
|
|
|
# Audit socket is not listed here because this unit can be turned off. However
|
|
|
|
# the link between the socket and the service units is still created thanks to
|
|
|
|
# the 'Service=' setting specified in the socket unit.
|
|
|
|
Sockets=systemd-journald.socket systemd-journald-dev-log.socket
|
2018-11-12 16:19:48 +00:00
|
|
|
StandardOutput=null
|
2017-02-08 21:32:37 +00:00
|
|
|
SystemCallArchitectures=native
|
2018-11-12 16:19:48 +00:00
|
|
|
SystemCallErrorNumber=EPERM
|
|
|
|
SystemCallFilter=@system-service
|
|
|
|
Type=notify
|
2023-03-16 10:22:58 +00:00
|
|
|
PassEnvironment=TERM
|
2021-05-16 09:55:36 +00:00
|
|
|
{{SERVICE_WATCHDOG}}
|
2011-12-30 16:50:37 +00:00
|
|
|
|
2020-11-25 08:47:46 +00:00
|
|
|
# In case you're wondering why CAP_SYS_PTRACE is needed, access to
|
2020-11-25 10:20:38 +00:00
|
|
|
# /proc/<pid>/exe requires this capability. Thus if this capability is missing
|
|
|
|
# the _EXE=/OBJECT_EXE= fields will be missing from the journal entries.
|
2020-11-25 08:47:46 +00:00
|
|
|
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
|
|
|
|
|
2018-10-01 16:08:27 +00:00
|
|
|
# If there are many split up journal files we need a lot of fds to access them
|
|
|
|
# all in parallel.
|
2021-05-16 09:55:36 +00:00
|
|
|
LimitNOFILE={{HIGH_RLIMIT_NOFILE}}
|