deepin开机自动启动服务备忘

systemctl enable mysql.service(设置开机自启)
sudo systemctl start nginx.service
sudo systemctl restart nginx.service
$ sudo systemctl stop nginx.service

PS:使用命令 systemctl is-enabled postfix.service 得到的值可以是enable、disable或static,这里的 static 它是指对应的 Unit 文件中没有定义[Install]区域,因此无法配置为开机启动服务。

刚刚配置的服务需要让systemctl能识别,就必须刷新配置

systemctl daemon-reload

sudo systemctl daemon-reload

最后采用wiki上的记录,在/etc/rc.local文件中添加即可,无需以上操作。
posted @ 2020-02-25 20:20  雪地里的蜗牛  阅读(1150)  评论(0编辑  收藏  举报