Linux 拨号vps windows公众号手机端

ubuntu怎么设置服务开机自启动

lewis 6年前 (2019-05-09) 阅读数 9 #网络运维
文章标签 ubuntu

要设置服务开机自启动,你可以使用以下步骤:

  1. 打开终端,使用以下命令查看当前已安装的服务:
sudo systemctl list-units --type=service
  1. 找到你想要设置开机自启动的服务,使用以下命令开启自启动:
sudo systemctl enable <service-name>

例如,如果你想要开机自启动nginx服务,可以使用以下命令:

sudo systemctl enable nginx
  1. 确认服务已被开启自启动,可以使用以下命令:
sudo systemctl is-enabled <service-name>

例如,检查nginx服务是否已经开启自启动:

sudo systemctl is-enabled nginx

通过以上步骤,你可以设置Ubuntu系统中的服务开机自启动。

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门