How to use systemctl in Ubuntu 14.04

前端 未结 4 1635
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 09:35

I try to perform the following command in Ubuntu 14.04:

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

I also tried it with sudo,

4条回答
  •  Happy的楠姐
    2021-01-31 10:01

    Ubuntu 14 and lower does not have "systemctl" Source: https://docs.docker.com/install/linux/linux-postinstall/#configure-docker-to-start-on-boot

    Configure Docker to start on boot:

    Most current Linux distributions (RHEL, CentOS, Fedora, Ubuntu 16.04 and higher) use systemd to manage which services start when the system boots. Ubuntu 14.10 and below use upstart.

    1) systemd (Ubuntu 16 and above):

    $ sudo systemctl enable docker
    

    To disable this behavior, use disable instead.

    $ sudo systemctl disable docker
    

    2) upstart (Ubuntu 14 and below):

    Docker is automatically configured to start on boot using upstart. To disable this behavior, use the following command:

    $ echo manual | sudo tee /etc/init/docker.override
    chkconfig
    
    $ sudo chkconfig docker on
    

    Done.

提交回复
热议问题