mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
mute-console: add simple varlink service that can disable log/status spew to kernel console
For "wizard" style interactive tools it's very annoying if they are interrupted by kernel log output or PID1's status output. let's add some infra to disable this temporarily. I decided to implement this as an IPC service so that we can make this robust: if the client request the muting dies we can automatically unmute again. This is hence a tiny varlink service, but it can also be started directly from the cmdline.
This commit is contained in:
@@ -143,6 +143,12 @@ units = [
|
||||
},
|
||||
{ 'file' : 'modprobe@.service' },
|
||||
{ 'file' : 'multi-user.target' },
|
||||
{
|
||||
'file' : 'systemd-mute-console.socket',
|
||||
'symlinks' : ['sockets.target.wants/']
|
||||
},
|
||||
{ 'file' : 'systemd-mute-console@.service' },
|
||||
{ 'file' : 'system-systemd\\x2dmute\\x2dconsole.slice' },
|
||||
{ 'file' : 'network-online.target' },
|
||||
{ 'file' : 'network-pre.target' },
|
||||
{ 'file' : 'network.target' },
|
||||
|
||||
19
units/system-systemd\x2dmute\x2dconsole.slice
Normal file
19
units/system-systemd\x2dmute\x2dconsole.slice
Normal file
@@ -0,0 +1,19 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# 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=Console Output Muting Service Slice
|
||||
Documentation=man:systemd-mute-console(8)
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Before=shutdown.target
|
||||
|
||||
[Slice]
|
||||
# Serialize requests to mute the console.
|
||||
ConcurrencySoftMax=1
|
||||
22
units/systemd-mute-console.socket
Normal file
22
units/systemd-mute-console.socket
Normal file
@@ -0,0 +1,22 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# 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=Console Output Muting Service Socket
|
||||
Documentation=man:systemd-mute-console(8)
|
||||
DefaultDependencies=no
|
||||
Before=sockets.target
|
||||
Conflicts=shutdown.target
|
||||
Before=shutdown.target
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/systemd/io.systemd.MuteConsole
|
||||
FileDescriptorName=varlink
|
||||
SocketMode=0600
|
||||
Accept=yes
|
||||
18
units/systemd-mute-console@.service
Normal file
18
units/systemd-mute-console@.service
Normal file
@@ -0,0 +1,18 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# 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=Console Output Muting Service
|
||||
Documentation=man:systemd-mute-console(8)
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Before=shutdown.target
|
||||
|
||||
[Service]
|
||||
ExecStart=systemd-mute-console
|
||||
Reference in New Issue
Block a user