palworld-server-docker
palworld-server-docker copied to clipboard
Pause without players
Context
- Adds the ability to pause the server
- Addressing #32
Choices
- Added an additional Script that will send a SIGSTOP to the server. After the process is suspended, it will monitor the server port for any connection attempts.
- If a player connects to the port it will resume the process and the player will be able to spawn without a timeout.
Feedback is appreciated, if you see something that can be improved!
Todo
- Add Cronjob
- RCON handling if the server is suspended
- Test how suspending the process reflects on the Ingame time
- Check if port is set
Test instructions
Manually
- Start the server with the default docker compose file
- run
docker exec palworld-server pause
- check the server log for a message, that the server has been paused
- run
echo>/dev/udp/127.0.0.1/8211
or start the game and login - check that the server has continued
Cron
- todo
Checklist before requesting a review
- [ ] I have performed a self-review of my code
- [ ] I've added documentation about this change to the README.
- [ ] I've not introduced breaking changes.
As an alternative to using SIGSTOP you could shutdown the server, monitor the port then start the server.
As an alternative to using SIGSTOP you could shutdown the server, monitor the port then start the server.
I think if I stop the server binary, I also stop the container because start.sh will exit.
I think if I stop the server binary, I also stop the container because start.sh will exit.
As written yes. With a few modifications to start.sh you could change that behavioral.
I think if I stop the server binary, I also stop the container because start.sh will exit.
As written yes. With a few modifications to start.sh you could change that behavioral.
Do you think it would make sense to make the pal server into a service so we can start/restart/stop it easier? If that's even possible inside the container.
Aside from that. I am not sure if a restart would be fast enough to connect again without timeout
Do you think it would make sense to make the pal server into a service so we can start/restart/stop it easier? If that's even possible inside the container.
I'm not sure how running as a service would make a difference.
You're probably right, the time to start the server might be too long. However SIGSTOP would cause issues with autoreboot.sh, backup.sh, and update.sh. Those don't check if the rcon command was successful, they assume it was.
The term handler in init.sh would produce an error for rcon too and it would hang as the server would never stop since the rcon stop would never be recieved by the paused server.
While it would prevent restore.sh from working properly, that wouldn't have an big issues as @seoseonyu did a great job with error handlers.
That isn't to say this isn't doable. It definitely is doable but it would be a big PR.
I would say something making that many changes should be multiple PRs due to the error handling, rcon checking, and status checking we would need to add to autoreboot.sh, backup.sh, and update.sh.
closing this. I think it is better for an external Script to pause the container instead of trying to stuff this in (at least at the moment). Maybe the game will give us a command in a later version.