Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question