如何在Ubuntu 14.04中使用systemctl?

我在Ubuntu 14.04中执行以下命令:

systemctl enable --now docker-cleanup-dangling-images.timer

我试过sudo,我用service和system d替换system ctl,但是没有任何效果。

sudo: systemd: command not found
systemd: command not found
sudo: service: command not foud

如何在Ubuntu 14.04中执行此命令

提问于 2018-02-17
 

2 个回答

用户回答回答于 2018-02-17

我刚刚自己遇到了这个问题,发现Ubuntu 14.04使用Upstart而不是Systemd,所以systemctl命令不起作用。

为了启用,通用看起来如下所示:

update-rc.d <service> enable

禁止服务开机自启:

update-rc.d <service> disable

链接到Ubuntu文档:https//wiki.ubuntu.com/SystemdForUpstartUsers

原文地址:https://www.cnblogs.com/netflix/p/15208910.html