0

I need to leave a service on systemd running because it doesn't activate? For what reason this happens since I follow the recommendation of the documentation, below are the codes:

Code of the Service :

# Contents of /etc/systemd/system/quark.service
[Unit]
Description=Quark
After=network.target

[Service]
Type=simple
User=cto
ExecStart=/usr/local/bin/python3.9 /var/net/
Restart=always

[Install]
WantedBy=multi-user.target

Status Code :

● quark.service - Quark
   Loaded: loaded (/etc/systemd/system/quark.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since Mon 2021-06-21 15:20:34 UTC; 8s ago
  Process: 1467 ExecStart=/usr/local/bin/python3.9 /var/net/ (code=exited, statu
 Main PID: 1467 (code=exited, status=1/FAILURE)

Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Main process exited, code=e
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Service RestartSec=100ms ex
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Scheduled restart job, rest
Jun 21 15:20:34 webstrucs systemd[1]: Stopped Quark.
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Start request repeated too 
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: Failed to start Quark.
  • Your service is complaining about too fast start requests. Is it configured correctly? I personally, to be honest, don't know Quark but if it's the retry/restart rate, the option you might want to change is RestartSec. Here's a related post: https://stackoverflow.com/a/39284869 – Antricks Jun 21 '21 at 16:10

1 Answers1

1

The ExecStart should be the command to be executed:

systemd manpages:

ExecStart=

Commands with their arguments that are executed when this service is started.

This stanza:

ExecStart=/usr/local/bin/python3.9 /var/net/

Should be:

ExecStart=/usr/local/bin/python3.9 path_to_python_script.py
GAD3R
  • 4,317
  • 1
  • 23
  • 34