我创建并启用了一个服务。
它存在并持续存在于两者之中:
我现在可以愉快地启动/停止/查看它的状态。但是当我重新启动时,无法启动它。我会收到以下信息:
然而:
每次我重新启动,都需要重新启用:
$ sudo systemctl enable /path/to/imaservice.service
Created symlink /etc/systemd/system/multi-user.target.wants/imaservice.service → /path/to/imaservice.service.
Created symlink /etc/systemd/system/imaservice.service → /path/to/imaservice.service.
它存在并持续存在于两者之中:
/etc/systemd/system/imaservice.service
/etc/systemd/system/multi-user.target.wants/imaservice.service
我现在可以愉快地启动/停止/查看它的状态。但是当我重新启动时,无法启动它。我会收到以下信息:
$sudo systemctl is-enabled imaservice
enabled
然而:
$sudo systemctl start imaservice
Failed to start imaservice.service: Unit imaservice.service not found.
每次我重新启动,都需要重新启用:
$sudo systemctl enable imaservice
$sudo systemctl daemon-reload
之后一切就恢复正常了。
我做错了什么?
imaservice.service
放在/etc/systemd/service
之外? - muru/lib/systemd/system
? - dOA/etc/systemd/system
。/lib/systemd/system
是用于软件包的。/etc/systemd/system
是系统管理员应该保存他们创建的单元的地方。 - muru