FS#35594 - [netctl] ExecUpPost starting ntpd service gives "start: command not found" but network starts anyway
Attached to Project:
Arch Linux
Opened by Frank Vanderham (twelveeighty) - Saturday, 01 June 2013, 20:49 GMT
Last edited by Jouke Witteveen (jouke) - Monday, 03 June 2013, 10:24 GMT
Opened by Frank Vanderham (twelveeighty) - Saturday, 01 June 2013, 20:49 GMT
Last edited by Jouke Witteveen (jouke) - Monday, 03 June 2013, 10:24 GMT
|
Details
Description:
I'm trying to start ntpd.service after a connection has been established by ifplugd using ExecUpPost: Description='Wired ethernet connection' Interface=net0 Connection=ethernet IP=dhcp DHCPClient=dhclient ExecUpPost=systemctl start ntpd.service This configuration does NOT start ntpd.service, the following error is produced: Jun 1 09:18:04 feanor ifplugd[447]: Using detection mode: SIOCETHTOOL Jun 1 09:18:04 feanor ifplugd[447]: Initialization complete, link beat not detected. Jun 1 09:18:04 feanor ifplugd[447]: Link beat detected. Jun 1 09:18:04 feanor ifplugd[447]: Executing '/etc/ifplugd/netctl.action net0 up'. Jun 1 09:18:04 feanor ifplugd[447]: client: up Jun 1 09:18:04 feanor ifplugd[447]: client: Reading profile 'ethernet-dhcp' Jun 1 09:18:04 feanor ifplugd[447]: client: /etc/netctl/ethernet-dhcp: line 6: start: command not found Jun 1 09:18:04 feanor ifplugd[447]: client: /etc/netctl/ethernet-dhcp: line 6: start: command not found Jun 1 09:18:04 feanor ifplugd[447]: client: Starting network profile 'ethernet-dhcp'... Jun 1 09:18:04 feanor ifplugd[447]: client: Started network profile 'ethernet-dhcp' However, even though the ExecUpPost fails, the profile is started anyway. I can appreciate that the ExecUpPost command must be enclosed in quotes (') for it to work, but the failure to execute should not start the network, afaik? |
This task depends upon
ExecUpPost=systemctl start ntpd.service
in a Bash terminal. What happens is that the command `start ntpd.service` is executed with the variable declaration `ExecUpPost=systemctl` in its environment.
When your profile is sourced by netctl, it is evaluated as a Bash script, so the above happens. In other words, what you see is a semantical error in your profile (worse: its syntactical in light of the netctl profile specification, but that is not checked for).