Closed TheDjRider closed 4 years ago
Did it generate a crash log? (The music bot of course, not the service)
No, nothing but sent in the message above.
I can't really help without more logs, but I'm guessing that the issue is using nohup ... &
in a service; nohup
is for terminal use, as it makes a process ignore the 'hangup' of closing the terminal, and &
is for running in the background, which in theory a service would already be doing. I would recommend trying different variations without nohup
or &
. Feel free to re-open this issue if you try those and can produce more logs that might hint at the origin of the issue.
if anyone else is having this issue here is my working one. make sure you change username, group, and working directory to your stuff. i was having the same issue and google brought me here @jagrosh was right about removing nohup
and &
. you also need the ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
so it will wait for a network connection. otherwise it will just error.
[Unit]
Description=musicbot systemd service unit file.
[Service]
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
WorkingDirectory=/home/musicbot/musicbot/
User=musicbot
Group=musicbot
ExecStart=java -Dnogui=true -jar JMusicBot.jar
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
Hello,
When i create subuser and edit the service file my code is:
[Service] WorkingDirectory=/home/eternalradio/ User=eternalradio Group=eternalradio ExecStart=nohup java -Dnogui=true -jar JMusic.jar &
RestartSec=15 Restart=always
[Install] WantedBy=multi-user.target
It start without errors but give:
and also the bot didn't start. If i load it on screen everything is ok but with this future is basically better to have it auto-load on system boot.
Also i have try other way to add startup command into run.sh file and put it into etrnalradio.service but again give the same error.