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文件中添加即可,無需以上操作。