E
E
error 4042019-07-28 01:29:33
linux
error 404, 2019-07-28 01:29:33

Why is the created systemd service not running?

Hello.
There was a need to run a python file on system boot, but when starting this service, I get an error:

Failed to start vkbot.service: Unit vkbot.service is not loaded properly: Exec format error.

[Unit]
Description=Vk bot start
After=multi-user.target

[Service]
Type=idle
ExecStart=python3.7 /home/xokare-kun/vkBotNew/vkBot.py

[Install]
WantedBy=multi-user.target

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Derepko, 2019-07-28
@ilovv

https://stackoverflow.com/questions/51858065/system...

V
Valentine, 2019-08-01
@ProFfeSsoRr

1) It does not work, most likely because the application is launched from the root of the file system, but it wants to be launched from its own folder. So in the [Service] section, you need to add the WorkingDirectory parameter.
2) Also, there is no shell in systemd units, so you need to specify full paths to executable files, i.e. instead of ExecStart=python3.7, you need to call the whereis python3.7 command in the console, it will show the full path and paste it into ExecStart, i.e. something like ExecStart=/usr/bin/python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question