ReD NeCKersoN wrote:Both of our coders are on vacation so it'll be a week or two before they can discuss these things with you.
ReD NeCKersoN wrote:When do you leave?
q3ded +set fs_game westernq3 +set dedicated 1 +exec server.cfg
\rcon exec server.cfg
sig11 wrote:If it is possible to remember the exec command and re-execute it after receiving a SIGHUP, this could be very useful.
sig11 wrote:But either way, I'm interested in your patch ! Maybe we can do something with it.
--- ./code/unix/linux_signals.c.orig Tue Aug 16 01:10:07 2005
+++ ./code/unix/linux_signals.c Tue Aug 15 21:38:23 2006
@@ -40,6 +40,28 @
}
signalcaught = qtrue;
+
+#ifdef DEDICATED
+ // Only for dedicated server
+ switch(sig)
+ {
+ case SIGHUP:
+ printf("Received signal %d, reloading...\n", sig);
+
+ // Add possible startup commands, given on command line,
+ // in the command text buffer
+ if ( Com_AddStartupCommands() )
+ {
+ // Then, execute them
+ Cbuf_Execute();
+ }
+ // Signal has been caught
+ signalcaught = qfalse;
+ return;
+ break;
+ }
+#endif
+
printf("Received signal %d, exiting...\n", sig);
#ifndef DEDICATED
GLimp_Shutdown(); // bk010104 - shouldn't this be CL_Shutdown
sig11 wrote:Maybe I'll add anothe signal handler (for e.g. USR1/USR2) to restart the current map and to change to the next map - or maybe not ... or maybe I'll give the game a possibility to store its PID to a file (just like any decent UNIX server ...).
kill -1 `cat /path/to/pidfile`
pkill -1 wqded
killall -1 wqded
hika wrote:About the PID file, if implementation is planned, what about a cvar to store its path ?
And then, something likewill be certainly more interesting than a
- Code: Select all
kill -1 `cat /path/to/pidfile`
or
- Code: Select all
pkill -1 wqded
especially if there are multiple wqded instance.
- Code: Select all
killall -1 wqded
If needed, I could help about these tiny things, as I guess there are not very important for the stand alone project (and wq3 players)
Just some comfort for server admins.
sig11 wrote:... and now the URL does not really answer ...