【发布时间】:2016-04-02 18:43:44
【问题描述】:
我已经为作为守护进程运行的 foo 服务整理了一个 foo.service 文件。当我运行systemctl start foo(和stop)时,服务运行良好,但是
systemtcl enable foo 导致 Failed to issue method call: Invalid argument。单元文件放在/etc/systemd/system/foo.service,权限为0755。将systemd设置为debug并运行enable给出了
Looking for unit files in (highest priority first):`
/etc/systemd/system
/run/systemd/system
/usr/local/lib/systemd/system
/usr/lib/systemd/system
Looking for SysV init scripts in:
/etc/rc.d/init.d
Looking for SysV rcN.d links in:
/etc/rd.c
Failed to issue method call: Invalid argument
四处搜索,似乎 systemctl 没有找到 .service 文件。有什么方法可以验证吗?如果是这样,我该如何解决?关于可能出错的任何其他想法?我可以启用更多调试吗?给出的调试信息并不能真正帮助我缩小问题范围。
foo.service 看起来像:
[Unit]
Description=Blah Blah Blah
[Service]
ExecStart=/usr/bar/doof/foo
Type=simple
PIDFile=/var/run/foo.pid
[Install]
WantedBy=multi-user.target,graphical.target
编辑:是的,我确实运行了systemctl daemon-reload。
【问题讨论】:
-
在添加或更改 foo.service 文件后,您是否运行过
systemctl daemon-reload? -
是的,我确实运行了 daemon-reload
标签: systemd