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
来源:https://www.cnblogs.com/holdoncomeon/p/12363550.html