# Ruby servers under daemontools (svc)

**URL:** <https://www.ruby-forum.com/t/ruby-servers-under-daemontools-svc/63876>\
**Category:** Ruby\
**Created:** [June 20, 2006, 1:52am UTC](https://www.ruby-forum.com/t/ruby-servers-under-daemontools-svc/63876 "2006-06-20T01:52:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [June 20, 2006, 1:52am UTC](https://www.ruby-forum.com/t/ruby-servers-under-daemontools-svc/63876/1 "2006-06-20T01:52:33Z")

</div>

I’m using ruby processes run under daemontools (on linux), and I’m not  
sure  
what’s going on with signals.

Playing with a very simple ruby “server”:

Signal.trap(“CONT”) { abort }  
while(1) do  
$stderr \<\< “errslp\n”  
$stdout \<\< “outslp\n”  
end

When I try to use svc commands (-d, -h) the process being monitored is  
running, but it’s PPID is set to 1 (init) and service has started a new  
process.

Just using kill to send SIGHUP does what I’d expect (the process dies  
and  
service restarts a new one).

Suggestions? Anyone else running ruby processes under daemontools?

- James M.

---

<div class="post-metadata">

**Author:** ![noagenda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8c91f0/32.png) [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Post date:** [June 21, 2006, 3:17am UTC](https://www.ruby-forum.com/t/ruby-servers-under-daemontools-svc/63876/2 "2006-06-21T03:17:43Z")

</div>

On Tue, Jun 20, 2006 at 08:48:41AM +0900, James M. wrote:

> When I try to use svc commands (-d, -h) the process being monitored is  
> running, but it’s PPID is set to 1 (init) and service has started a new  
> process.
> 
> Just using kill to send SIGHUP does what I’d expect (the process dies and  
> service restarts a new one).
> 
> Suggestions? Anyone else running ruby processes under daemontools?

What does your run file look like? And what does readproctitle show, if  
anything?

When I stick the above in a file and prepend `#!/usr/bin/env ruby’ and  
make it  
executable it works fine (on FreeBSD).
