
"thin -C" always return 0 (success) even if servers failed to start/stop
Reported by Iñaki Baz Castillo | December 21st, 2009 @ 07:11 AM | in Future
Using "thin -R config.ru -d start/stop" the return code depends on the success/failure of the operation. However when using "-C cluster.conf" thin command returns 0 (success) even if the servers failed to start/stop.
For example: I've started thin cluster (3 servers) with root user and now try to stop them with normal user ("ibc"):
First I try to stop an individual server:
~$ thin -P pid.9292 stop
Sending QUIT signal to process 16016 ...
/usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.5/lib/thin/daemonizing.rb:113:in `kill': Operation not permitted (Errno::EPERM)
~$ echo $?
1
Due to permissions issues I get an error and 1 as return code (OK).
Now I try using "thin -C":
~$ thin -C cluster.conf stop
Stopping server on 0.0.0.0:9292 ...
Sending QUIT signal to process 16016 ...
/usr/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.5/lib/thin/daemonizing.rb:113:in `kill': Operation not permitted (Errno::EPERM)
~$ echo $?
0
Unfortunatelly it returns 0 (success). This is a very big issue when using service init scripts or some daemons (as HeartBeat) which totally rely on service response status.
So I suggest "thin -C" to collect all the response status from individual "thin -R" calls and return 0 just in case all the operations returned 0.
Comments and changes to this ticket
-
Iñaki Baz Castillo December 21st, 2009 @ 08:05 AM
I attach 2 patches that solve the issue. Note that 'open4' is required rather than 'open3' (the difference is that 'open4' also gets the command exit status).
-
Iñaki Baz Castillo December 21st, 2009 @ 08:15 AM
- no changes were found...
-
RyanLord December 22nd, 2020 @ 09:01 AM
Nidd of the twelfth house and all formation is plucked for the tools. The changes in the help with accounting homework are encountered for the goals. The fastened report is fit for the movement for the goals for all people.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Attachments
Tags
Referenced by
-
121 "thin -d" always returns 0 (success) even if servers failed to start/stop Note that this bug is different than #119.