2020-11-09 13:23:58 +09:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2017-11-18 17:35:03 +01:00
|
|
|
#
|
2011-12-30 17:50:37 +01:00
|
|
|
# This file is part of systemd.
|
|
|
|
|
#
|
|
|
|
|
# systemd is free software; you can redistribute it and/or modify it
|
2012-04-12 00:20:58 +02: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 17:50:37 +01:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=Journal Service
|
2012-06-01 17:26:28 +02:00
|
|
|
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
|
2011-12-30 17:50:37 +01:00
|
|
|
DefaultDependencies=no
|
|
|
|
|
Requires=systemd-journald.socket
|
2014-11-03 20:58:24 +01:00
|
|
|
After=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket syslog.socket
|
2012-08-24 23:18:35 +02:00
|
|
|
Before=sysinit.target
|
2011-12-30 17:50:37 +01:00
|
|
|
|
2025-04-07 17:33:44 +09:00
|
|
|
# To avoid journald being SIGKILLed during soft-reboot and corrupting journals.
|
2023-11-28 08:32:22 +09:00
|
|
|
# See https://github.com/systemd/systemd/issues/30195
|
2024-05-23 00:03:42 +09:00
|
|
|
# Note, typically soft-reboot.target will be never reached,
|
|
|
|
|
# and systemd-soft-reboot.service will trigger soft-reboot.
|
|
|
|
|
# Hence, this must be stopped before systemd-soft-reboot.service.
|
|
|
|
|
Before=soft-reboot.target systemd-soft-reboot.service
|
2023-11-28 08:32:22 +09:00
|
|
|
Conflicts=soft-reboot.target
|
|
|
|
|
|
2022-06-29 13:14:37 +02: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 17:50:37 +01:00
|
|
|
[Service]
|
2019-05-01 15:28:36 +03:00
|
|
|
DeviceAllow=char-* rw
|
2023-06-12 02:15:19 +01:00
|
|
|
ExecStart={{LIBEXECDIR}}/systemd-journald
|
2017-07-17 10:04:37 +02:00
|
|
|
FileDescriptorStoreMax=4224
|
2024-05-31 16:40:12 +01:00
|
|
|
# Ensure services using StandardOutput=journal do not break when journald is stopped
|
|
|
|
|
FileDescriptorStorePreserve=yes
|
2023-12-21 15:32:15 +00:00
|
|
|
ImportCredential=journal.*
|
2018-11-12 17:19:48 +01:00
|
|
|
IPAddressDeny=any
|
|
|
|
|
LockPersonality=yes
|
2016-06-08 12:23:37 +00:00
|
|
|
MemoryDenyWriteExecute=yes
|
2018-11-12 17:19:48 +01:00
|
|
|
NoNewPrivileges=yes
|
2019-11-27 21:18:10 +01:00
|
|
|
OOMScoreAdjust=-250
|
2020-04-02 21:18:11 +03:00
|
|
|
ProtectClock=yes
|
2018-11-12 17:19:48 +01: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 17:19:48 +01:00
|
|
|
RestrictNamespaces=yes
|
|
|
|
|
RestrictRealtime=yes
|
2019-03-20 19:52:20 +01:00
|
|
|
RestrictSUIDSGID=yes
|
2019-11-27 21:18:28 +01:00
|
|
|
RuntimeDirectory=systemd/journal
|
|
|
|
|
RuntimeDirectoryPreserve=yes
|
2022-12-06 20:15:43 +01: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 17:19:48 +01:00
|
|
|
StandardOutput=null
|
2017-02-08 22:32:37 +01:00
|
|
|
SystemCallArchitectures=native
|
2018-11-12 17:19:48 +01:00
|
|
|
SystemCallErrorNumber=EPERM
|
|
|
|
|
SystemCallFilter=@system-service
|
2025-06-11 23:32:27 +00:00
|
|
|
Type=notify-reload
|
2023-03-16 11:22:58 +01:00
|
|
|
PassEnvironment=TERM
|
2021-05-16 11:55:36 +02:00
|
|
|
{{SERVICE_WATCHDOG}}
|
2011-12-30 17:50:37 +01:00
|
|
|
|
2020-11-25 09:47:46 +01:00
|
|
|
# In case you're wondering why CAP_SYS_PTRACE is needed, access to
|
2020-11-25 11:20:38 +01: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 09:47:46 +01: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 18:08:27 +02:00
|
|
|
# If there are many split up journal files we need a lot of fds to access them
|
|
|
|
|
# all in parallel.
|
2021-05-16 11:55:36 +02:00
|
|
|
LimitNOFILE={{HIGH_RLIMIT_NOFILE}}
|