On 1 Jun 2015, at 06:14, Sebastian Hagedorn <Hagedorn@uni-koeln.de> wrote:
--On 28. Mai 2015 11:52:05 -0400 Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On May 28, 2015, at 11:13 AM, Sebastian Hagedorn <Hagedorn@uni-koeln.de> wrote:
--On 27. Mai 2015 11:25:52 -0400 Alan DeKok <aland@deployingradius.com> wrote:
The "radmin -e hup" command did not throw an error. Consequently the commit was tagged as "stable". When I tried to manually restart Freeradius on the remote server, it didn't start anymore (as expected). At that point I wasn't even able to push a fix, because radmin doesn't work when the server isn't running, and so the post-receive hook reverted back to the "stable" version! I had to fix the error manually on the remote server to get things working again.
That's a bit of a different issue. If the server isn't running, then you should be able to push updates. Please send a patch.
For that particular problem I have come up with this, which seems to work:
I thought about that when I was writing the script. The issue is you don't know when the server has come up fully, so you may run into race conditions.
At the time, I think there was still the issue where the child process wasn't signalling the parent that an error had occurred, so even if the child exited with an error, the parent would exit with 0.
In later versions of v2 and v3 the parent waits until the child process signals that initialisation has completed successfully, so the parent should exit with a code that signals whether the server as a whole came up correctly.
The proper way to achieve what you're trying to do, is to ensure that the init script passes back the exit code of the parent process, and use that to determine if the server has come up.
When you check the status of the process using the init script, you're just checking whether the process still exists immediately after its created. There's no guarantee it'll still exist five seconds after its been created. Module initialization delays opening sockets, so whilst your patched script may work for you, it wouldn't work well for an instance of the server where several hundred connections are opened to a database, even in the same scenario, with the conflicting listen sections.
Now that the patch that allows changes to be pushed when the server isn't running has been pulled, I'm returning to the other issue. Alan wrote:
The check should really be without radmin. Just stop the server and re-start it.
Arran's post seems to contradict that. Please correct me if my understanding is wrong: Arran is saying that you cannot rely on the return value of the init script, because it returns before the server has fully initialized. Is that really true?
I said it used to, I then said it was fixed, and that we need to verify that the exit code is passed through in the init scripts.
If that's really the case, I guess the only way to make absolutely sure would be to sleep for, say, 30 seconds and to check that the server is still up ...
No. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2