Ausführen eines python-Skript mit Vorgesetzten

Ich kopiert von hier, um mein Python-code als daemon.
Für zusätzliche Betriebszeit. Ich dachte, es wäre eine bessere Idee, mit Vorgesetzten zu halten, dieser daemon läuft.

Habe ich dies getan.
python_deamon.conf

[program:python_deamon]
directory=/usr/local/python_deamon/
command=/usr/local/python_venv/bin/python daemon_runnner.py start
stderr_logfile=/var/log/gunicorn.log
stdout_logfile=/var/log/gunicorn.log
autostart=true
autorestart=true

Das problem ist, dass, obwohl supervisor " erfolgreich gestartet die python_daemon es hält wiederholen.

2015-09-23 16:10:45,592 CRIT Supervisor running as root (no user in config file)
2015-09-23 16:10:45,592 WARN Included extra file "/etc/supervisor/conf.d/python_daemon.conf" during parsing
2015-09-23 16:10:45,592 INFO RPC interface 'supervisor' initialized
2015-09-23 16:10:45,592 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-09-23 16:10:45,592 INFO supervisord started with pid 13880
2015-09-23 16:10:46,595 INFO spawned: 'python_deamon' with pid 17884
2015-09-23 16:10:46,611 INFO exited: python_deamon (exit status 1; not expected)
2015-09-23 16:10:47,614 INFO spawned: 'python_deamon' with pid 17885
2015-09-23 16:10:47,630 INFO exited: python_deamon (exit status 1; not expected)
2015-09-23 16:10:49,635 INFO spawned: 'python_deamon' with pid 17888
2015-09-23 16:10:49,656 INFO exited: python_deamon (exit status 1; not expected)
2015-09-23 16:10:52,662 INFO spawned: 'python_deamon' with pid 17891
2015-09-23 16:10:52,680 INFO exited: python_deamon (exit status 1; not expected)
2015-09-23 16:10:53,681 INFO gave up: python_deamon entered FATAL state, too many start retries too quickly

Nur für das Protokoll die nach dem überladen run() Methode, die ich nie wieder etwas.

Ist es möglich, das zu tun, was ich versuche zu tun, oder bin ich dumm ?

P. S: ich weiß, dass die Ursache des ganzen Problems ist, da run() nie wieder etwas supervisor hält zu versuchen, es zu starten und somit denkt, dass der Prozess fehlgeschlagen ist und gibt den status als FATAL Exited too quickly (process log may have details).

Meine eigentliche Frage ist, mache ich es richtig ? oder kann man das auf diese Weise getan ?

P. P. S: Stand-alone(ohne Betreuer) daemon_runnner.py läuft wunderbar mit und ohne sudo-Berechtigungen.

Haben Sie geprüft daemon_runnner.py ohne daemon? Es beendet sich mit status-code 1.

InformationsquelleAutor Nagri | 2015-09-23

Schreibe einen Kommentar