Answer the question
In order to leave comments, you need to log in
What is the error (systemd doesn't run python script)?
In the /etc/systemd/system
file vkbot.service
, see below.
[Unit]
Description=VK_BOT
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/vkbot/bot.py
Restart=always
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable vkbot.service
Created symlink /etc/systemd/system/multi-user.target.wants/vkbot.service → /etc/systemd/system/vkbot.service
systemctl start vkbot
systemctl status vkbot
● vkbot.service - VK_BOT
Loaded: loaded (/etc/systemd/system/vkbot.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-12-01 10:58:21 UTC; 17s ago
Process: 32463 ExecStart=/usr/local/bin/vkbot/bot.py (code=exited, status=203/EXEC)
Main PID: 32463 (code=exited, status=203/EXEC)
Dec 01 10:58:21 ithater systemd[1]: Started VK_BOT.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Main process exited, code=exited, status=203/EXEC
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Scheduled restart job, restart counter is at 5.
Dec 01 10:58:21 ithater systemd[1]: Stopped VK_BOT.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Start request repeated too quickly.
Dec 01 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 01 10:58:21 ithater systemd[1]: Failed to start VK_BOT.
../var/log
in the file :syslog
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Scheduled restart job, restart counter is at 4.
Dec 1 10:58:21 ithater systemd[1]: Stopped VK_BOT.
Dec 1 10:58:21 ithater systemd[1]: Started VK_BOT.
Dec 1 10:58:21 ithater systemd[32463]: vkbot.service: Failed to execute command: No such file or directory
Dec 1 10:58:21 ithater systemd[32463]: vkbot.service: Failed at step EXEC spawning /usr/local/bin/vkbot/bot.py: No such file or directory
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Main process exited, code=exited, status=203/EXEC
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Service hold-off time over, scheduling restart.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Scheduled restart job, restart counter is at 5.
Dec 1 10:58:21 ithater systemd[1]: Stopped VK_BOT.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Start request repeated too quickly.
Dec 1 10:58:21 ithater systemd[1]: vkbot.service: Failed with result 'exit-code'.
Dec 1 10:58:21 ithater systemd[1]: Failed to start VK_BOT.
Failed to execute command: No such file or directory
Answer the question
In order to leave comments, you need to log in
/usr/local/bin/vkbot/bot.py
and ../usr/local/bin/vkbot/bot.py
are generally different paths. you should make sure that in your case they are identical (or not identical, and correct this matter).
what does the command ls -l /usr/local/bin/vkbot/
typed in the terminal say?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question