* daemon under runit?
@ 2006-12-05 22:34 Toni Mueller
2006-12-06 13:46 ` Alex Efros
0 siblings, 1 reply; 3+ messages in thread
From: Toni Mueller @ 2006-12-05 22:34 UTC (permalink / raw)
Cc: support
Hello,
I'm struggling with a program that, in many cases, forks to become a
daemon, that I'd like to run under runit (1.7.1). So far, I tried to
start the program in the run script, then wait in a 'finish' script for
it, and also have a control/t script to kill it if someone says
something like "sv down service". Unfortunately, in most cases, this
does not seem to work - the control/t script is not accessed when I
issue 'sv down service' (as "ls -lta" shows). One of the problems is
that the file supervise/pid contains the pid of the finish script in
case the program forked, no longer the pid of the daemon itself. I
hoped to achieve something similar to fghack (from daemontools), but so
far failed.
This is on Debian GNU/Linux, kernel 2.6.18.
Any ideas are _very_ welcome!
Best,
--Toni++
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: daemon under runit?
2006-12-05 22:34 daemon under runit? Toni Mueller
@ 2006-12-06 13:46 ` Alex Efros
2006-12-14 13:02 ` Toni Mueller
0 siblings, 1 reply; 3+ messages in thread
From: Alex Efros @ 2006-12-06 13:46 UTC (permalink / raw)
Hi!
On Tue, Dec 05, 2006 at 11:34:42PM +0100, Toni Mueller wrote:
> I'm struggling with a program that, in many cases, forks to become a
"in many cases"?! I.e. it fork sometimes and sometimes don't fork?! ;-)
> daemon, that I'd like to run under runit (1.7.1). So far, I tried to
> start the program in the run script, then wait in a 'finish' script for
> it, and also have a control/t script to kill it if someone says
> something like "sv down service". Unfortunately, in most cases, this
> does not seem to work - the control/t script is not accessed when I
> issue 'sv down service' (as "ls -lta" shows). One of the problems is
You should use control/d instead of control/t if you wish to catch `sv down`.
> that the file supervise/pid contains the pid of the finish script in
> case the program forked, no longer the pid of the daemon itself. I
> hoped to achieve something similar to fghack (from daemontools), but so
> far failed.
It's usually simple enough to patch any program to not fork.
--
WBR, Alex.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: daemon under runit?
2006-12-06 13:46 ` Alex Efros
@ 2006-12-14 13:02 ` Toni Mueller
0 siblings, 0 replies; 3+ messages in thread
From: Toni Mueller @ 2006-12-14 13:02 UTC (permalink / raw)
Alex Efros wrote:
> On Tue, Dec 05, 2006 at 11:34:42PM +0100, Toni Mueller wrote:
>> something like "sv down service". Unfortunately, in most cases, this
>> does not seem to work - the control/t script is not accessed when I
>> issue 'sv down service' (as "ls -lta" shows). One of the problems is
>
> You should use control/d instead of control/t if you wish to catch `sv down`.
Well, the man page says that control/t is executed before d or x on
either 'down' or 'exit'. From http://smarden.sunsite.dk/runit/runsv.8.html:
"On command d first service/control/t is checked, and then
service/control/d. On command x first service/control/t is checked, and
then service/control/x."
> It's usually simple enough to patch any program to not fork.
That's what I eventually did.
Thank you!
Best,
--Toni++
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-14 13:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-05 22:34 daemon under runit? Toni Mueller
2006-12-06 13:46 ` Alex Efros
2006-12-14 13:02 ` Toni Mueller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).