Open christian1211 opened 4 years ago
Try changing the command in ExecStart
in arkmanager@.service
from start
to start --no-background
, and changing the Type
from forking
to exec
. In this case, ExecStop
should not be required, as a SIGTERM
should cleanly shut down the server.
I changed arkmanager@.service like this:
[Unit]
Description=Daemon to start an ark server instance
[Service]
User=steam
Group=steam
ExecStart=/usr/local/bin/arkmanager useconfig %i start --no-background
#ExecStop=/usr/local/bin/arkmanager useconfig %i stop
Type=exec
Restart=always
RestartSec=30
KillMode=process
TimeoutSec=120
Seems not working. I tried shutdown and reboot inside the os and shutdown and reboot from hypervisor but in all cases the world has not been saved.
Does it work if you use arkmanager stop @all
?
Does it work if you use killall -INT ShooterGameServer
?
If the answer is no to both, then that suggests that something (for example a mod) is preventing the normal world save on graceful shutdown.
arkmanager stop @all
- the worlds have been saved
killall -INT ShooterGameServer
- the worlds have been saved
So with both commands the worlds have been saved.
btw. the os is Debian 10.
Does it save the world at all (e.g. when you run arkmanager rconcmd @instance saveworld
)?
Does journalctl -u 'arkmanager*'
reveal anything?
arkmanager rconcmd @instance saveworld - yes, the world has been saved
journalctl -u 'arkmanager*'
shows one error for each instance:
/etc/systemd/system/arkmanager@.service:9: Failed to parse service type, ignoring: exec
You say you have Debian Buster (Debian 10), yet your systemd does not support Type=exec
(as documented in https://manpages.debian.org/buster/systemd/systemd.service.5.en.html).
It looks like Type=exec
was added in systemd v240 (see https://github.com/systemd/systemd/commit/79905a246d645d21633f09f564b3672d5085a85c), and Buster is supposed to include systemd v241
Ok my fault: I had Ubuntu 18.04 (I thought it was Debian 10, sorry!) before which doesn't support Type=exec
as it has systemd v237 included. I updated everything to Ubuntu 20.04 now, which has systemd v245 included. The error message disappeared.
But still it's not saving the world at reboot or shutdown.
I uncommented ExecStop
again in arkmanager@.service
and added --saveworld
and it seems working like this.
[Unit]
Description=Daemon to start an ark server instance
[Service]
User=steam
Group=steam
ExecStart=/usr/local/bin/arkmanager useconfig %i start --no-background
ExecStop=/usr/local/bin/arkmanager useconfig %i stop --saveworld
Type=exec
Restart=always
RestartSec=30
KillMode=process
TimeoutSec=120
Maybe before it didn't work because of the older systemd version. Thank you!
stop --saveworld
does an explicit rconcmd saveworld
.
It sounds almost as if the script is not being permitted to send a signal to the game server, which results in the script and game server being killed with SIGKILL
after the 120 second timeout expires.
But this means that after the shutdown command the service would wait 120 seconds to exit. After I use the shutdown or reboot command it exits immediately within maybe 2 or 3 seconds, there is no waiting for timeout. I have no idea where to look for the issue. :/
I'm using the system services for arkmanager. When I shutdown the server (VM), the instances doesn't save the world before shutdown.
Here my service files:
arkmanager.service
arkmanager@.service
I think it's my fault but I'm not able to find the problem.