linux服务随开机自启动设置

docker服务随开机一起启动
systemctl enable --now docker

以下是systemctl中关于--now参数的解释:

       --now
           When used with enable, the units will also be started. When used with disable or mask, the units will also be stopped.
           The start or stop operation is only carried out when the respective enable or disable operation has been successful.

翻译:

  • 1、当和enable一起使用的时候,设置为开机启动,然后启动服务
  • 2、当和disable一起使用的时候,取消开机启动,关闭服务
  • 3、只有当disable或者enable操作成功了之后,关闭或启动服务的操作才会发生。

 

posted @ 2023-04-02 10:52  总统先生  阅读(44)  评论(0编辑  收藏  举报