04 Aralık 2018 14:16

Muslu Y.

Python

Python systemd scriptini servis gibi kullanmak

Anasayfa

Python

Python systemd scriptini servis gibi kullanmak...

Python scriptinizi Linux üzerinde systemd ile servisi gibi kullanmak isterseniz aşağıdaki gibi bir dosya oluşturup

nano /lib/systemd/system/tornadotest.service

 

[Unit]
Description=Django & Tornado Service
[Service]
User=root
Restart=always
WorkingDirectory=/home/muslu/django/tornadotest/tornadotest/
ExecStart=/usr/bin/python3.6 /home/muslu/django/tornadotest/tornadotest/app.py
StandardInput=tty-force
[Install]
WantedBy=multi-user.target

 

Değişikliği uygulama

systemctl daemon-reload 

 

 

Servisinizi başlatmak için

systemctl restart tornodatest

 

Python

hakkında diğer konular

Makdos Bilişim Teknolojileri 2015 - 2025