Bot as systemd daemon breaks #894
-
Trying to run this as a systemd daemon causes it to break [Unit]
Description=music bot
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=server
ExecStart=/usr/bin/env java -Dnogui=true -Dconfig=/home/server/music-bot/config.txtjar /home/server/music-bot/JMusicBot-0.3.5.jar
[Install]
WantedBy=multi-user.target This causes: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Should be:
[Unit]
After=network.target network-online.target
Requires=network.target network-online.target
[Service]
WorkingDirectory=/home/server/music-bot Hope I could help. |
Beta Was this translation helpful? Give feedback.
-
This might seem a bit off topic but I can also suggest the following additional settings for the service file: [Unit]
StartLimitIntervalSec=500
StartLimitBurst=5
[Service]
Restart=on-failure
RestartSec=5s As you can tell this will automatically restart the service after 5 seconds if it happens to exit with a crash. |
Beta Was this translation helpful? Give feedback.
ExecStart=/usr/bin/env java -Dnogui=true -Dconfig=/home/server/music-bot/config.txtjar /home/server/music-bot/JMusicBot-0.3.5.jar
Should be:
ExecStart=/usr/bin/env java -Dnogui=true -Dconfig=/home/server/music-bot/config.txt -jar /home/server/music-bot/JMusicBot-0.3.5.jar
You also probably want to set stuff like
Hope I could help.