Describe the bug
Whenever I try to restart the rust-server container using systemd or using cron jobs and a batch file, the container just inifinitely boot loops.
To Reproduce
Steps to reproduce the behavior:
Create a container using the following command:
docker run --name rust-server-auto -d -p 28015:28015 -p 28015:28015/udp -p 28016:28016 -p 8080:8080 -p 28083:28083 -v /opt/rust/server:/steamcmd/rust --env-file /opt/rust/rust.env didstopia/rust-server
Create a script to restart the container with the following contents:
!/bin/bash
docker exec rust-server-auto rcon say Server is saving before restarting
docker exec rust-server-auto rcon server.save
docker exec rust-server-auto rcon say Server is now going down for daily restart
docker stop rust-server-auto
docker rm -f rust-server-auto
docker run --name rust-server-auto -d -p 28015:28015 -p 28015:28015/udp -p 28016:28016 -p 8080:8080 -p 28083:28083 -v /opt/rust/server:/steamcmd/rust --env-file /opt/rust/rust.env didstopia/rust-server
Create a cron job to run this command as the user that created the container
Watch the containerfail to restart at the specified time
Run the commands manually at 4AM and watch the container magically boot up because you entered the command in an interactive shell instead (Sorry this has been driving me a little insane!)
Expected behaviour
I expect that regardless of running the commands interactively or through a SystemD unit file or a script run by a cronjob that the behaviour is identical - the server restarts cleanly and does not boot loop
Screenshots
None applicable, not even any useful log output.
The container never gets as far as steam trying to update rust however, it just restarts to the Didstopia ascii logo
Environment (please complete the following information):
OS: Debian 10
Docker: Docker version 19.03.14, build 5eb3275d40
Additional context
I am not the most proficient docker admin, so I fully expect that this is an issue of my own creation.
I understand that you may not be able to help me, but really any help in trying to resolve/troubleshoot this would be greatly appreciated!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug Whenever I try to restart the rust-server container using systemd or using cron jobs and a batch file, the container just inifinitely boot loops.
To Reproduce Steps to reproduce the behavior:
!/bin/bash
docker exec rust-server-auto rcon say Server is saving before restarting docker exec rust-server-auto rcon server.save docker exec rust-server-auto rcon say Server is now going down for daily restart docker stop rust-server-auto docker rm -f rust-server-auto docker run --name rust-server-auto -d -p 28015:28015 -p 28015:28015/udp -p 28016:28016 -p 8080:8080 -p 28083:28083 -v /opt/rust/server:/steamcmd/rust --env-file /opt/rust/rust.env didstopia/rust-server
Expected behaviour I expect that regardless of running the commands interactively or through a SystemD unit file or a script run by a cronjob that the behaviour is identical - the server restarts cleanly and does not boot loop
Screenshots None applicable, not even any useful log output. The container never gets as far as steam trying to update rust however, it just restarts to the Didstopia ascii logo
Environment (please complete the following information):
Additional context I am not the most proficient docker admin, so I fully expect that this is an issue of my own creation. I understand that you may not be able to help me, but really any help in trying to resolve/troubleshoot this would be greatly appreciated!