linux 开机自启
参考:http://www.jinbuguo.com/systemd/systemd.service.html
#创建.service文件
vim /etc/systemd/system/[服务名].service
[Unit]
Description=[服务描述]
After=syslog.target
After=network.target
[Service]
Type=simple
User=root
Group=root
WorkingDirectory=[工作目录]
ExecStart=[要执行的命令]
Restart=always
[Install]
WantedBy=multi-user.target
#让服务生效并启动
systemctl enable [服务名].service
systemctl start [服务名].service