Systemd,无法启动 dcos-link-env.service

Systemd,无法启动 dcos-link-env.service

以下是systemctl status dcos-link-env.service

 ● dcos-link-env.service
       Loaded: loaded (/etc/systemd/system/dcos-link-env.service; static; vendor preset: enabled)
       Active: failed (Result: exit-code) since Tue 2016-09-27 16:40:42 MYT; 54min ago
      Process: 7021 ExecStartPre=/usr/bin/mkdir -p /etc/profile.d (code=exited, status=203/EXEC)

    Sep 27 16:40:42 slave1 systemd[1]: Starting dcos-link-env.service...
    Sep 27 16:40:42 slave1 systemd[1]: dcos-link-env.service: Control process exited, code=exited status=203
    Sep 27 16:40:42 slave1 systemd[1]: Failed to start dcos-link-env.service.
    Sep 27 16:40:42 slave1 systemd[1]: dcos-link-env.service: Unit entered failed state.
    Sep 27 16:40:42 slave1 systemd[1]: dcos-link-env.service: Failed with result 'exit-code'.
    Warning: dcos-link-env.service changed on disk. Run 'systemctl daemon-reload' to reload units.

更新 1:我按照“Mark Stosberg”提供的解决方案操作,并解决了他提到的问题。但是出现了一个有点模糊的新错误(至少对我来说)。以下是错误。

systemctl status dcos-link-env
● dcos-link-env.service
   Loaded: loaded (/etc/systemd/system/dcos-link-env.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2016-09-29 17:08:16 MYT; 2min 43s ago
 Main PID: 7814 (code=exited, status=203/EXEC)

Sep 29 17:08:16 agenttest3 systemd[1]: Starting dcos-link-env.service...
Sep 29 17:08:16 agenttest3 systemd[1]: dcos-link-env.service: Main process exited, code=exited, status=203/EXEC
Sep 29 17:08:16 agenttest3 systemd[1]: Failed to start dcos-link-env.service.
Sep 29 17:08:16 agenttest3 systemd[1]: dcos-link-env.service: Unit entered failed state.
Sep 29 17:08:16 agenttest3 systemd[1]: dcos-link-env.service: Failed with result 'exit-code'.

答案1

看看这一行:

>  ExecStartPre=/usr/bin/mkdir -p /etc/profile.d (code=exited, status=203/EXEC)

因此,此命令以失败代码退出。您是否以 root 身份在 CLI 上运行了该命令以确认其按预期运行?

在 Ubuntu 16.04 上,which mkdir显示该二进制文件位于/bin/mkdir,而不是/usr/bin/mkdir您所拥有的。

相关内容