我尝试在Ubuntu 14.04中执行以下命令:
systemctl enable --now docker-cleanup-dangling-images.timer
我也尝试了与sudo,我试图取代systemctl与服务和systemd,但没有任何作品
sudo: systemd: command not found systemd: command not found sudo: service: command not foud
我怎样才能在Ubuntu 14.04执行这个命令,或者有另一种方法来执行相同的命令?
我只是自己遇到这个问题,发现Ubuntu 14.04使用Upstart而不是Systemd,所以systemctl命令将不起作用。 这在15.04更改,所以一个方法是更新你的Ubuntu安装。
如果这不是你的选择(现在不适合我),你需要找到你需要做的Upstart命令。
为了启用,通用看起来如下:
update-rc.d <service> enable
链接到Ubuntu文档: https : //wiki.ubuntu.com/SystemdForUpstartUsers
我试图按照使用pm2的指导,自己寻找答案时遇到了这个问题。 目标是在服务器上自动启动node.js应用程序。 有些指南使用pm2 startup systemd
,这是导致在Ubuntu 14.04上使用systemctl的问题的路径。 相反,使用pm2 startup ubuntu
。
资料来源: https : //www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04
所以你想删除悬挂的图像? 我对么?
systemctl enable docker-container-cleanup.timer systemctl start docker-container-cleanup.timer systemctl enable docker-image-cleanup.timer systemctl start docker-image-cleanup.timer
https://github.com/larsks/docker-tools/tree/master/docker-maintenance-units