centOSでデーモン化がうまくいきません。
watchDog.pyファイル常時実行されるように、デーモン化しようとしており、
watchDog.py自体は単体で正常にプログラムが実行されます。
/etc/systemd/systemにwatchDog.serviceという名前でデーモンファイルを作成後、
このコマンドを実行すると以下のように表示されます。
systemctl status watchDog.service -l
● watchDog.service - SFTP Sync Daemon Loaded: loaded (/etc/systemd/system/watchDog.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since 土 2020-02-22 19:02:43 JST; 5min ago Process: 2218 ExecStart=/usr/local/pyenv/shims/python /var/www/cgi-bin/watchDogs/watchDog.py (code=exited, status=217/USER) Main PID: 2218 (code=exited, status=217/USER) 2月 22 19:02:43 118-27-15-148 systemd[1]: watchDog.service: main process exited, code=exited, status=217/USER 2月 22 19:02:43 118-27-15-148 systemd[1]: Failed to start SFTP Sync Daemon. 2月 22 19:02:43 118-27-15-148 systemd[1]: Unit watchDog.service entered failed state. 2月 22 19:02:43 118-27-15-148 systemd[1]: watchDog.service failed. 2月 22 19:02:43 118-27-15-148 systemd[1]: watchDog.service holdoff time over, scheduling restart. 2月 22 19:02:43 118-27-15-148 systemd[1]: Stopped SFTP Sync Daemon. 2月 22 19:02:43 118-27-15-148 systemd[1]: start request repeated too quickly for watchDog.service 2月 22 19:02:43 118-27-15-148 systemd[1]: Failed to start SFTP Sync Daemon. 2月 22 19:02:43 118-27-15-148 systemd[1]: Unit watchDog.service entered failed state. 2月 22 19:02:43 118-27-15-148 systemd[1]: watchDog.service failed.
#watchDog.service [Unit] Description=SFTP Sync Daemon [Service] User=istamp ExecStart=/usr/local/pyenv/shims/python /var/www/cgi-bin/watchDogs/watchDog.py Restart=always Type=notify WatchdogSec=1 [Install] WantedBy=multi-user.target
journalctl -xe コマンド実行
-- -- The result is failed. 2月 22 19:20:32 118-27-15-148 systemd[1]: Unit watchDog.service entered failed state. 2月 22 19:20:32 118-27-15-148 systemd[1]: watchDog.service failed. 2月 22 19:20:32 118-27-15-148 systemd[1]: watchDog.service holdoff time over, scheduling restart. 2月 22 19:20:32 118-27-15-148 systemd[1]: Stopped SFTP Sync Daemon. -- Subject: Unit watchDog.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit watchDog.service has finished shutting down. 2月 22 19:20:32 118-27-15-148 systemd[1]: Starting SFTP Sync Daemon... -- Subject: Unit watchDog.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit watchDog.service has begun starting up. 2月 22 19:20:32 118-27-15-148 systemd[2286]: Failed at step USER spawning /usr/local/pyenv/shims/python: No such pr -- Subject: Process /usr/local/pyenv/shims/python could not be executed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- The process /usr/local/pyenv/shims/python could not be executed and failed. -- -- The error number returned by this process is 3. 2月 22 19:20:32 118-27-15-148 systemd[1]: watchDog.service: main process exited, code=exited, status=217/USER 2月 22 19:20:32 118-27-15-148 systemd[1]: Failed to start SFTP Sync Daemon. -- Subject: Unit watchDog.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit watchDog.service has failed. -- -- The result is failed. 2月 22 19:20:32 118-27-15-148 systemd[1]: Unit watchDog.service entered failed state. 2月 22 19:20:32 118-27-15-148 systemd[1]: watchDog.service failed. 2月 22 19:20:33 118-27-15-148 systemd[1]: watchDog.service holdoff time over, scheduling restart. 2月 22 19:20:33 118-27-15-148 systemd[1]: Stopped SFTP Sync Daemon. -- Subject: Unit watchDog.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit watchDog.service has finished shutting down. 2月 22 19:20:33 118-27-15-148 systemd[1]: start request repeated too quickly for watchDog.service 2月 22 19:20:33 118-27-15-148 systemd[1]: Failed to start SFTP Sync Daemon. -- Subject: Unit watchDog.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit watchDog.service has failed. -- -- The result is failed. 2月 22 19:20:33 118-27-15-148 systemd[1]: Unit watchDog.service entered failed state. 2月 22 19:20:33 118-27-15-148 systemd[1]: watchDog.service failed.
なにが原因でデーモン化出来ないのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。