1. 打开一个文件hello.service

vim /etc/systemd/system/hello.service

2. 

[Unit]
Description=uWSGI instance to serve file-redis-load
After=network.target

[Service]
User=root
Group = nginx
WorkingDirectory=/var/www/demoapp
Environment="PATH=/usr/local/python3/bin"
ExecStart=/usr/bin/uwsgi --ini demoapp_uwsgi.ini

[Install]
WantedBy=multi-user.target

3. 启动

systemctl daemon-reload
systemctl start hello.service
systemctl stop hello.servcie
systemctl restart hello.service

 

systemctl enable hello.service  开机启动
systemctl disable hello.service

 

systemctl is-enabled hello.service 查看开机是否启动

 

相关文章:

  • 2021-06-17
  • 2021-07-28
  • 2021-08-21
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-04-10
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
相关资源
相似解决方案