Can not start a script with systemd
Hello list,
I'm running a game server on a VPS (Alien Arena). I have a script to
load it and it works fine when I invoke it. However when trying to load
it from systemd it always fails. Also this is my first attemp to load
something from systemd. Fresh install debian stable fully updated.
The script to start alienarena-ded:
#! /bin/sh
killall alienarena-ded
sleep 5
cd /home/aaserver/aa
./alienarena-ded +set game arena +exec ctfir.cfg
exit 0
And the unit file:
[Unit]
Description=Alien Arena Dedicated Server
[Service]
Type=exec
User=aaserver
ExecStart=/home/aaserver/aas.sh
ExecStop=/usr/bin/killall alienarena-ded
ExecReload=/home/aaserver/aas.sh
[Install]
WantedBy=multi-user.target
For the service type I have tried exec, simple and forking. All have
the same behaviour:
aas.service - Alien Arena Dedicated Server
Loaded: loaded (/etc/systemd/system/aas.service; enabled; vendor
preset: enabled)
Active: failed (Result: exit-code) since Sun 2022-03-13 12:13:40
CET; 7min ago
Process: 3053 ExecStart=/home/aaserver/aas.sh (code=exited,
status=0/SUCCESS)
Process: 3059 ExecStop=/usr/bin/killall alienarena-ded
(code=exited, status=1/FAILURE)
Main PID: 3053 (code=exited, status=0/SUCCESS)
CPU: 11ms
Mar 13 12:13:35 nanos systemd[1]: Starting Alien Arena Dedicated
Server...
Mar 13 12:13:35 nanos systemd[1]: Started Alien Arena Dedicated Server.
Mar 13 12:13:35 nanos aas.sh[3054]: alienarena-ded: no process found
Mar 13 12:13:40 nanos killall[3059]: alienarena-ded: no process found
Mar 13 12:13:40 nanos systemd[1]: aas.service: Control process exited,
code=exited, status=1/FAILURE
Mar 13 12:13:40 nanos systemd[1]: aas.service: Failed with result
'exit-code'
Any help is appreciated
TIA
Reply to: