diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-11-27 14:47:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-01-31 15:03:55 +0100 |
commit | dc5437c78bbfe02d7bc0d8adad25575aeaf75c28 (patch) | |
tree | d5b47c0ca9fd2fe3a5ff183a809bb257250fbf39 /units | |
parent | 65c398c031a3065caf34d258d4f9c50cd33a122c (diff) | |
download | systemd-dc5437c78bbfe02d7bc0d8adad25575aeaf75c28.tar.gz |
journald: add ability to activate by varlink socket
If we have exit on idle, then operations such as "journalctl
--namespace=foo --rotate" should work even if the journal daemon is
currently not running.
(Note that we don't do activation by varlink for the main instance of
journald, I am not sure the deadlocks it might introduce are worth it)
Diffstat (limited to 'units')
-rw-r--r-- | units/meson.build | 1 | ||||
-rw-r--r-- | units/systemd-journald-varlink@.socket | 18 | ||||
-rw-r--r-- | units/systemd-journald@.service.in | 4 |
3 files changed, 21 insertions, 2 deletions
diff --git a/units/meson.build b/units/meson.build index c0b69566d1..0dc85ac64a 100644 --- a/units/meson.build +++ b/units/meson.build @@ -115,6 +115,7 @@ units = [ ['systemd-machine-id-commit.service', '', 'sysinit.target.wants/'], ['systemd-journald@.socket', ''], + ['systemd-journald-varlink@.socket', ''], ['systemd-networkd.socket', 'ENABLE_NETWORKD'], ['systemd-poweroff.service', ''], ['systemd-reboot.service', ''], diff --git a/units/systemd-journald-varlink@.socket b/units/systemd-journald-varlink@.socket new file mode 100644 index 0000000000..b6730c2fa5 --- /dev/null +++ b/units/systemd-journald-varlink@.socket @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# 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 +# (at your option) any later version. + +[Unit] +Description=Journal Varlink Socket for Namespace %i +Documentation=man:systemd-journald.service(8) man:journald.conf(5) +StopWhenUnneeded=yes + +[Socket] +Service=systemd-journald@%i.service +ListenStream=/run/systemd/journal.%i/io.systemd.journal +SocketMode=0600 diff --git a/units/systemd-journald@.service.in b/units/systemd-journald@.service.in index 43082fa41b..e7ea919328 100644 --- a/units/systemd-journald@.service.in +++ b/units/systemd-journald@.service.in @@ -10,8 +10,8 @@ [Unit] Description=Journal Service for Namespace %i Documentation=man:systemd-journald.service(8) man:journald.conf(5) -Requires=systemd-journald@%i.socket -After=systemd-journald@%i.socket +Requires=systemd-journald@%i.socket systemd-journald-varlink@%i.socket +After=systemd-journald@%i.socket systemd-journald-varlink@%i.socket [Service] CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID CAP_MAC_OVERRIDE |