Skip to content

Commit e07b7ad

Browse files
bengaljohannbg
authored andcommitted
fix(network-manager): show output on console only with rd.debug enabled
The module should show the output on console only when initrd debugging is enabled.
1 parent 51c06d9 commit e07b7ad

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

modules.d/35network-manager/nm-config.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
1616
echo '[logging]'
1717
echo 'level=TRACE'
1818
) > /run/NetworkManager/conf.d/initrd-logging.conf
19+
20+
if [ -n "$DRACUT_SYSTEMD" ]; then
21+
mkdir -p /run/systemd/system/nm-initrd.service.d
22+
cat << EOF > /run/systemd/system/nm-initrd.service.d/tty-output.conf
23+
[Service]
24+
StandardOutput=tty
25+
EOF
26+
systemctl --no-block daemon-reload
27+
fi
1928
fi
2029

2130
nm_generate_connections

modules.d/35network-manager/nm-initrd.service

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ BusName=org.freedesktop.NetworkManager
1717
ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
1818
ExecStart=/usr/sbin/NetworkManager --debug
1919
KillMode=process
20-
StandardOutput=tty
20+
# The following gets changed to StandardOutput=tty by nm-config.sh
21+
# when debug is enabled.
22+
StandardOutput=null
2123
Environment=NM_CONFIG_ENABLE_TAG=initrd
2224
Restart=on-failure
2325
ProtectSystem=true

0 commit comments

Comments
 (0)