这文档说:
NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d directory
它还说:
The environment contains more information about the interface and the connection. The following variables are available for the use in the dispatcher scripts: NM_DISPATCHER_ACTION The dispatcher action like "up" or "dhcp4-change", identical to the first command line argument. Since NetworkManager 1.12.0. ......
我的问题是,当环境变量仅在该上下文中可用时,我如何测试或调试这些脚本。
答案1
不完全是调试,但你可以看到 stdout
systemctl status NetworkManager-dispatcher.service
这正是我读到这篇文章时所需要的