Skip to content

Commit

Permalink
fix(network-manager): show output on console only with rd.debug enabled
Browse files Browse the repository at this point in the history
The module should show the output on console only when initrd debugging is
enabled.
  • Loading branch information
bengal authored and johannbg committed Oct 21, 2021
1 parent 51c06d9 commit e07b7ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions modules.d/35network-manager/nm-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
echo '[logging]'
echo 'level=TRACE'
) > /run/NetworkManager/conf.d/initrd-logging.conf

if [ -n "$DRACUT_SYSTEMD" ]; then
mkdir -p /run/systemd/system/nm-initrd.service.d
cat << EOF > /run/systemd/system/nm-initrd.service.d/tty-output.conf
[Service]
StandardOutput=tty
EOF
systemctl --no-block daemon-reload
fi
fi

nm_generate_connections
4 changes: 3 additions & 1 deletion modules.d/35network-manager/nm-initrd.service
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ BusName=org.freedesktop.NetworkManager
ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
ExecStart=/usr/sbin/NetworkManager --debug
KillMode=process
StandardOutput=tty
# The following gets changed to StandardOutput=tty by nm-config.sh
# when debug is enabled.
StandardOutput=null
Environment=NM_CONFIG_ENABLE_TAG=initrd
Restart=on-failure
ProtectSystem=true
Expand Down

0 comments on commit e07b7ad

Please sign in to comment.