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服务启动状态

 

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-09-04
  • 2021-11-03
  • 2021-07-01
猜你喜欢
  • 2022-02-06
  • 2021-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案