I have the following launcher.sh file:
cd /root/craig/mybot
tmux new-session -d -s mybot "'/usr/bin/python3.5' launcher.py --start --auto-restart"
I then have the following mybot.service file in /systemd/system:
[Unit]
After=network.target
[Service]
ExecStart=/root/craig/mybot/launcher.sh
[Install]
WantedBy=default.target
When I run /root/craig/mybot/launcher.sh
it works perfectly fine, but when I reboot my server the service starts and it seems like launcher.sh is never started (because the bot never comes online). Why is this? The service is shown as enabled. I'm on centOS 7.
When I run systemctrl status mybot
, I get:
May 25 03:48:56 vultr.guest systemd[1]: Starting mybot.service...
May 25 03:48:56 vultr.guest systemd[818]: Failed at step EXEC spawning /root/craig/mybot/launcher.sh: Exec format error
May 25 03:48:56 vultr.guest systemd[1]: mybot.service: control process exited, code=exited status=203
May 25 03:48:56 vultr.guest systemd[1]: Failed to start mybot.service.
May 25 03:48:56 vultr.guest systemd[1]: Unit mybot.service entered failed state.
May 25 03:48:56 vultr.guest systemd[1]: mybot.service failed.
#! /bin/sh
at the top of yourlauncher.sh
script to make it work. – Mio Rin May 25 '18 at 04:41