networkmanager script failing, how to see full logs output
Mar 8
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)"
1 answer
Accepted answer · original discussion
Mar 8
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
...
Your perspective belongs here.
Sign in with a verified account to contribute.
2 question comments
Use comments to ask for clarification. Post a solution as an answer.
Mar 8
set -x would make the script output be in logs, wouldn't it?Mar 8