#[Solved]set up a custom systemd unit

6 messages · Page 1 of 1 (latest)

smoky salmon
#

trying to run a discord bot as a service
it works when run normally
logs:`sudo systemctl status mbot
Warning: The unit file, source configuration file or drop-ins of mbot.service changed on disk. Run 'systemctl daemon-reload' to reload units.
× mbot.service - JMusicBot
Loaded: bad-setting (Reason: Unit mbot.service has a bad unit file setting.)
Active: failed (Result: exit-code) since Thu 2023-03-09 20:28:47 EST; 20min ago
Duration: 7ms
Main PID: 115502 (code=exited, status=200/CHDIR)
CPU: 4ms

Mar 09 20:28:46 archserver systemd[1]: /etc/systemd/system/mbot.service:11: Neither a valid executable name nor an absolute path: user/bin/env
Mar 09 20:28:46 archserver systemd[1]: mbot.service: Unit configuration has fatal error, unit will not be started.
Mar 09 20:28:47 archserver systemd[1]: mbot.service: Failed to schedule restart job: Unit mbot.service has a bad unit file setting.
Mar 09 20:28:47 archserver systemd[1]: mbot.service: Failed with result 'exit-code'.
`
so im guessing i messed up the config but idk how

#

heres the config file:`[Unit]
Description=JMusicBot
Requires=network.target
After=network.target

[Service]
WorkingDirectory=/home/kraken
User=kraken
Group=wheel
Type=simple
ExecStart=/usr/local/bin/java -Dnogui=true -jar /home/kraken/musicbot/JMusicBot-0.3.9.jar
Restart=always
RestartSec=20
StandartOutput=syslog

[Install]
WantedBy=multi-user.target
`

#

things i tried: running as diff users and changing the /usr/local/bin/java to /sbin/java and /bin/java

#

main error message: /etc/systemd/system/mbot.service:11: Neither a valid executable name nor an absolute path: user/bin/env

#

restarted pc now works

#

idk