#119 new
Iñaki Baz Castillo

"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

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.

New-ticket Create new ticket

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

Pages