要设置服务开机自启动,你可以使用以下步骤:
sudo systemctl list-units --type=service
sudo systemctl enable <service-name>
例如,如果你想要开机自启动nginx服务,可以使用以下命令:
sudo systemctl enable nginx
sudo systemctl is-enabled <service-name>
例如,检查nginx服务是否已经开启自启动:
sudo systemctl is-enabled nginx
通过以上步骤,你可以设置Ubuntu系统中的服务开机自启动。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:ubuntu如何设置服务开机自启动