Closed Wobak closed 6 months ago
This may fit more in the setup wiki page, or perhaps a separate wiki page: Using service managers for JMusicBot.
so is this an open issue to get correct systemd configuration, or request to update the wiki with configuration steps?
Latter, a request to update the Wiki with a systemd example.
still new to systemd, but was able to get it working with this config. Added isntall section to make sure network is working before it tries to run the bot (at least from my understanding)
[Unit]
Description=JMusic Bot
After=network-online.target
[Service]
Environment=JMusicDIR=/home/BotUser/Musicbot
Environment=JMusicExec=JMusicBot-0.3.5.jar
Environment=JMusicCfg=config.txt
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
ExecStart=/usr/bin/java -Dnogui=true -Dconfig=${JMusicDIR}/${JMusicCfg} -jar ${JMusicDIR}/${JMusicExec}
Type=simple
User=BotUser
Restart=on-failure
[Install]
WantedBy=network-online.target
as a pre-req, I had a non root user created on my ubuntu machine named BotUser.
unit file will be created under (musicbot.service) /etc/systemd/system/
commands to enable and add service to systemd sudo systemctl start musicbot.service sudo systemctl enable musicbot.service
any changes to service file you will need to run sudo systemctl daemon-reload
Hi,
I had already put one in my first comment :)
The running as a service page has been added a good while ago & this issue is still open, whoops! Well... it's there now :)
Is your feature request related to a problem? Please describe. No way to put the server headless on an auto startup mechanism
Describe the solution you'd like Example systemd service file
Describe the basic flow/steps of using this feature How this feature would be used:
Additional context I created the file and put it here as an example :
Have you confirmed that this idea is not already described here? Yes
Then :