1
1
1thater2019-12-01 14:07:19
linux
1thater, 2019-12-01 14:07:19

What is the error (systemd doesn't run python script)?

In the /etc/systemd/systemfile 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

Then I enter the following commands into the console (PuTTy).
- systemctl daemon-reload
- systemctl enable vkbot.service
answer :
Created symlink /etc/systemd/system/multi-user.target.wants/vkbot.service → /etc/systemd/system/vkbot.service

- systemctl start vkbot
- systemctl status vkbot
answer :
● 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.

The following information is ../var/login 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.

From line 5 we see
Failed to execute command: No such file or directory

But the file is there.
Here it is:
5de39ed57164e339084099.png
What's the problem?)
PS OS - Ubuntu 18.04

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2019-12-01
@1thater

/usr/local/bin/vkbot/bot.pyand ../usr/local/bin/vkbot/bot.pyare 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 question

Ask a Question

731 491 924 answers to any question