systemctl enable --now docker 中--now是什么意思?


OK,在一次的部署docker的过程中,见到在部署文档中,有这么个命令

systemctl enable --now docker 

那么这个 --now 参数是什么意思呢··· ···

查了下,就是:

设置为开机启动,并且,现在启动这个docker服务。

就是把原来的 enable之后start命令给合并到一起了。

以下是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操作成功了之后,关闭或启动服务的操作才会发生。

OK,以上就是关于--now参数的介绍。

相关