Bot won't read config.txt file when starting through systemctl on Ubuntu Server 16.04 LTS
See original GitHub issueGeneral Troubleshooting
Please check off these steps before suggesting a feature or reporting a bug:
- I am running the latest version:
- I have followed all instructions on the setup page (and if applicable, Raspberry Pi)
- I have read through the planned and suggested features
Issue
Issue Type
- Bug Report
- Feature Request
Description
When starting MusicBot through systemctl the bot complains about no API Token being provided even though the config.txt has the API Token Entered
/etc/systemd/system/musicbot.service
[Unit]
Description=MusicBot
[Service]
ExecStart=/usr/bin/java -jar /opt/SpotifyChan/spotifychan.jar -nogui
Type=simple
User=root
[Install]
WantedBy=multi-user.target
The System Status Displays the following
● musicbot.service - MusicBot
Loaded: loaded (/etc/systemd/system/musicbot.service; enabled; vendor pres
Active: failed (Result: exit-code) since Mon 2018-05-21 14:00:02 UTC; 4min 55
Main PID: 4070 (code=exited, status=1/FAILURE)
May 21 14:00:02 OrangeVM2 java[4070]: Bot Token:
May 21 14:00:02 OrangeVM2 java[4070]: Exception in thread "main" java.util.NoSuchElementException
May 21 14:00:02 OrangeVM2 java[4070]: at java.util.Scanner.throwFor(Scanner.java:862)
May 21 14:00:02 OrangeVM2 java[4070]: at java.util.Scanner.next(Scanner.java:1371)
May 21 14:00:02 OrangeVM2 java[4070]: at com.jagrosh.jmusicbot.Config.prompt(Config.java:310)
May 21 14:00:02 OrangeVM2 java[4070]: at com.jagrosh.jmusicbot.Config.<init>(Config.java:129)
May 21 14:00:02 OrangeVM2 java[4070]: at com.jagrosh.jmusicbot.JMusicBot.main(JMusicBot.java:91)
May 21 14:00:02 OrangeVM2 systemd[1]: spotifychan.service: Main process exited, code=exited, status=1/FAILURE
May 21 14:00:02 OrangeVM2 systemd[1]: spotifychan.service: Unit entered failed state.
May 21 14:00:02 OrangeVM2 systemd[1]: spotifychan.service: Failed with result 'exit-code'.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
"Welcome to emergency mode!" Think it is a fsck problem
I was able to mount ntfs partition sda3 but on restart Ubuntu was starting in emergency mode. To fix this issue, run the...
Read more >I can't get the right items to boot on ubuntu-16.04 and systemd
I have no idea where ubuntu is deciding this. i can't find any config files that point to /sbin/nginx . No logs help....
Read more >Ubuntu Server 20.04.3 LTS won't open a login shell on ...
for the RPi4B Ubuntu server install (or desktop install) the correct config.txt file to edit is located in the /boot/firmware directory.
Read more >Ubuntu Server 16.04 systemctl service with python script is ...
After fiddling around i am at the point that the service is started via systemctl (and running) but the script is doing nothing......
Read more >Ubuntu Manpage: systemd.service - Service unit configuration
If a service is requested under a certain name but no unit configuration file is found, systemd looks for a SysV init script...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Wasn’t looking the the correct directory I fixed this issue by adding 2 lines under the service file
If you don’t specify the WorkingDirectory and RootDirectory it uses the User’s default home which in this case the user ‘root’ doesn’t have a home directory so java was freaking out
Gimme just one second I’m gonna try something see if it’s not spitting out the full logs