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 @   总统先生  阅读(56)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
点击右上角即可分享
微信分享提示