大网数据广告活动
服务器运维问答

networkmanager script failing, how to see full logs output

· 52CE 我爱测

journalctl -u NetworkManager.service tells me dispatcher: 01-ifupdown [...] /etc/NetworkManager/dispatcher.d/01-ifupdown exited with error status 1 This is almost certainly a script we have hooked/symlinked in /etc/network/if-up.…

问题原文

原帖链接 · some bits flipped · CC BY-SA 4.0

journalctl -u NetworkManager.service tells me dispatcher: 01-ifupdown [...] /etc/NetworkManager/dispatcher.d/01-ifupdown exited with error status 1

This is almost certainly a script we have hooked/symlinked in /etc/network/if-up.d/our-hook, however all such scripts run without error when run directly.

Where can I find, or how can I enable, a full capture of stdout/stderr for all things network manager runs (narrowing verbosity to if-up.d is obviously fine, too). Insight into the vernacular relating to this answer would be helpful, too - I'm sure this information exists but my search-foo is coming up short.

ubuntu server 18.04

the script in questions begins with the following. On the test device, /bin/sh symlinks to dash

#!/bin/sh
set -xue
echo "[...] $(date)"

已采纳解答

原帖链接 · some bits flipped · CC BY-SA 4.0

it turns out it's NOT NetworkManager.service that would have the relevant logs:

a different service, NetworkManager-dispatcher.service, is what runs scripts in /etc/network/if-*.d/* - and the journalctl for that service does in fact have all stdout/stderr from the operation.

And for the curious, the underlying error was an exec format error from run-parts; the script we have generating the hooks had an extra newline i had not noticed:

# --> extra newline here, before ~shebang
#!/bin/sh
...

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-03-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。