mirror of
https://github.com/parkervcp/eggs.git
synced 2026-06-12 09:03:35 +08:00
added helper to help cave exit gracefully
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Signal handler function
|
||||
handle_signal() {
|
||||
echo "Signal received, executing c_shutdown()"
|
||||
c_shutdown
|
||||
}
|
||||
|
||||
# Trap TERM and INT signals and call handle_signal when they are received
|
||||
trap handle_signal TERM INT
|
||||
|
||||
# Start your server process here (run in the background if necessary)
|
||||
./dontstarve_dedicated_server_nullrenderer_x64 -bind_ip 0.0.0.0 -port 11000 -persistent_storage_root /home/container/DoNotStarveTogether -conf_dir config -cluster server -players {{MAX_PLAYERS}} -shard Caves &
|
||||
|
||||
# Wait for server process to exit
|
||||
wait $!
|
||||
|
||||
echo "Server process exited, script ending"
|
||||
@@ -1,5 +1,7 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=./Supervisord/supervisord.log
|
||||
pidfile=./Supervisord/supervisord.pid
|
||||
|
||||
[supervisorctl]
|
||||
|
||||
@@ -10,7 +12,7 @@ port = 127.0.0.1:9001
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[program:caves]
|
||||
command=/bin/sh -c './dontstarve_dedicated_server_nullrenderer_x64 -bind_ip 0.0.0.0 -port 11000 -persistent_storage_root /home/container/DoNotStarveTogether -conf_dir config -cluster server -players {{MAX_PLAYERS}} -shard Caves'
|
||||
command=/bin/sh -c './cave_helper.sh'
|
||||
autostart=true
|
||||
autorestart=false
|
||||
redirect_stderr=true
|
||||
@@ -18,6 +20,7 @@ stdout_logfile=/home/container/DoNotStarveTogether/config/server/Caves/server_lo
|
||||
directory=/home/container/bin64
|
||||
depends_on=master
|
||||
stopsignal=TERM
|
||||
stopwaitsecs=60
|
||||
|
||||
[program:master]
|
||||
command=/bin/sh -c './dontstarve_dedicated_server_nullrenderer_x64 -bind_ip 0.0.0.0 -port {{SERVER_PORT}} -persistent_storage_root /home/container/DoNotStarveTogether -conf_dir config -cluster server -players {{MAX_PLAYERS}} -shard Master'
|
||||
@@ -25,4 +28,4 @@ autostart=true
|
||||
autorestart=false
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/home/container/DoNotStarveTogether/config/server/Master/server_log.txt
|
||||
directory=/home/container/bin64
|
||||
directory=/home/container/bin64
|
||||
|
||||
Reference in New Issue
Block a user