Official Soldat Forums

Server Talk => Server Discussion => Topic started by: FliesLikeABrick on July 07, 2006, 07:40:29 am

Title: server not obeying kill signal?
Post by: FliesLikeABrick on July 07, 2006, 07:40:29 am
I've noticed that as of 2.5.1 (maybe 2.5.0 too, but I wouldn't know, I skipped 2.4.9 --> 2.5.1) that my servers can no longer be killed with the normal `kill` signal, but the -9/TERM signal needs to be sent in order for it to end.  It was never like this before version 2.5.1 (or 2.5.0)

Any insight?
Title: Re: server not obeying kill signal?
Post by: frogboy on July 07, 2006, 09:37:27 am
Could be this, from 2.5.0 changelog:
- Added Linux Servers will clean up properly when terminated with TERM(15) or QUIT(3) signals.
Title: Re: server not obeying kill signal?
Post by: FliesLikeABrick on July 07, 2006, 11:13:09 am
yeah, thats the only change that I can imagine would cause it to act oddly like this
Title: Re: server not obeying kill signal?
Post by: jrgp on July 07, 2006, 12:52:49 pm
Oh, your having that problem to aye?

Yeah, I was going to shut down the server so I could disable the m79 so I hit:
top
u jrgp
Saw the pid (it was like 3863, can't really remember) and hit k 3863.

But nothing happened. So I rebooted the pc tweaked the soldat.ini and started it like I usually do: nohup ./soldatserver > /dev/null &

But how exactly do I kill the process now?
Title: Re: server not obeying kill signal?
Post by: mar77a on July 07, 2006, 01:48:23 pm
kill [pid] -9
killall soldatserver
Title: Re: server not obeying kill signal?
Post by: chrisgbk on July 08, 2006, 02:03:00 am
By default, kill sends signal 15 doesn't it? That would mean that the server is catching the kill signal, but not properly exiting.

kill -9 would be the best bet until it gets fixed then, because 9 is the only signal that an application can't catch. The downside is that the dedicated server is unable to clean up after itself (write logs, etc). Of course, this would be the same as it USED to be, when it never caught these signals.
Title: Re: server not obeying kill signal?
Post by: FliesLikeABrick on July 08, 2006, 02:04:37 am
I'm glad to see that this has been confirmed.

The thing is (and this is especially important because of my stats apps) that I really need it to clean up properly, so -9 isn't a preferable option.
Title: Re: server not obeying kill signal?
Post by: chrisgbk on July 08, 2006, 02:39:14 am
I'm glad to see that this has been confirmed.

The thing is (and this is especially important because of my stats apps) that I really need it to clean up properly, so -9 isn't a preferable option.

I can understand that, BUT: until 2.5.0 the server didn't clean up itself AT ALL: 2.4.9 and below treated TERM/15 as KILL/9 (speaking of which, you mixed up the name and the number in your original post :P TERM isn't 9, check 'kill -l'), so they would implicitly lose data due to them never ever writing log files at that point. Hence why this new functionality was added.

However, after talking with EnEsCe, and some testing, we may have found the cause.

Now, for the workaround: sending kill -15 will cause the server to save all its data, it just won't properly shutdown. So if you want to save data, send kill -15, wait a few seconds to give it time, then send kill -9. Easy enough to do in code.
Title: Re: server not obeying kill signal?
Post by: FliesLikeABrick on July 08, 2006, 03:44:06 am
Thanks for clearing that up, at least my point was clear enough to present the problem
Title: Re: server not obeying kill signal?
Post by: EnEsCe on July 08, 2006, 05:08:38 am
The bug has now been fixed, and also made the server more stable in the process.
Credit to Chrisgbk for fixing this one.
Title: Re: server not obeying kill signal?
Post by: Leo on July 08, 2006, 06:56:27 am
I know this doesn't belong to this topic but I have to ask. When can we expect 2.5.2 ? EnEsCe, I hope you made it so that tkills reset at the end of every map :)
Title: Re: server not obeying kill signal?
Post by: EnEsCe on July 08, 2006, 07:02:46 am
Yeah I have changed it to reset the TKills, and I cant say when 2.5.2 comes out. Theres alot of scrap metal in there that needs to be recyled.
Title: Re: server not obeying kill signal?
Post by: Leo on July 08, 2006, 07:42:15 am
I could beta test new version in one of my servers if you have anything ready ;)
Title: Re: server not obeying kill signal?
Post by: FliesLikeABrick on July 08, 2006, 02:27:57 pm
I want to sincerely thank EnEsCe for taking over the server development, the dedicated server has come a very far way since EnEsCe first got involved, back before he took over the entire development.  We all remember back when the dedicated server was unstable, crashed with custom maps .... yeah.

Thanks.