This guide is now deprecated. Install UdderlyUpToDate and enable the autorestart toggle in the mods tab on the control panel.
If you run a larger server or just want to do less maintenance on your server once you have your mods set up, you can use this guide to configure a mod and script to automatically restart the server when mods are detected.
The mod used is UdderlyUpToDate, which will detect the mod updates and issue restart warnings in the chat as the restart approaches. UdderlyUpToDate will shut down the server, the script will start it back up again. This is because it is not possible to issue a restart command from a mod. It is only possible to shut down the server. UdderlyUpToDate also has mod options that can be customized.
A script will also be implemented on the server to start the server if it is ever stopped, in this case by UdderlyUpToDate.
*Note: The “Stop” feature on the control panel will no longer work. Your server will always be online.
This is an advanced guide. Use at your own risk.
1. Install UdderlyUpToDate as a normal mod, adding the Mod ID and Workshop ID
2. Open the File Manager
3. Navigate to /server-files/
4. Cut and Paste server-start.sh
to /
5. Right click /server-start.sh
and click Edit
6. Add while true
do
before the following lines and done
after
LD_PRELOAD="${LD_PRELOAD}:${JSIG}" ./ProjectZomboid64 "$@"
and LD_PRELOAD="${LD_PRELOAD}:${JSIG}" ./ProjectZomboid32 "$@"
Your file should look exactly like this, the added lines have been highlighted:
*Note: Spacing and formatting is extremely important. Make sure your editor matches this exactly.
7. Save server-start.sh
and open docker-compose.yml
8. Add the following line under volumes:
- ./start-server.sh:/server-files/start-server.sh
9. Ensure it is exactly lined up with the lines above. It should look like this:
10. Save the file. Save Config & Restart from the Basic Server Settings. This is important so your changes to docker-compose.yml
are applied
11. Once the server is back online, the server will now restart each time UdderlyUpToDate shuts it down