系统相关
首页 > 系统相关> > ubuntu添加开机启动程序

ubuntu添加开机启动程序

作者:互联网

cd  /etc/systemd/system

vim startspiderimg.server:


[Unit]
Description=It is startspiderimg

[Service]
Type=simple
ExecStart=/home/ubuntu/virtualenvs/myfirst/bin/python /home/ubuntu/mymount/project/myproject/wanwenyc/WWSpider/mybase/spiderXiuRenMeiMvWang.py
#启动失败之后重启
Restart=on-failure
#重启间隔为5s
RestartSec=5s

[Install]
WantedBy=multi-user.target

然后 

systemctl enable startspiderimg  :注册服务

systemctl start startspiderimg  :注册服务

 

service startspiderimg status  :查看startspiderimg服务启动状态

 

标签:systemctl,启动,startspiderimg,5s,添加,ubuntu,开机,home
来源: https://www.cnblogs.com/jingzaixin/p/15863506.html