Bug#441316: sv once ineffective if 'finish' exists and is executable

2007-09-11 Thread Andras Korn
On Mon, Sep 10, 2007 at 12:27:39PM +, Gerrit Pape wrote:

Hi,

> > if ./finish exists and is executable, runsv will execute it and then 
> > restart 
> > the service even if it was in the 'sv once' state.
> 
> Hmm, it doesn't fail for me

You're right. It was my fault, but the scenario is, I think, instructive. :)

I have two services that depend on each other: x depends on y. Hence, x/run
does "sv start y || exit 1", whereas y/finish stops x. So far, so good.

However, x doesn't deal well with the TERM signal and only exits cleanly on
a SIGUSR1. I now realize the clean way would have been to write an
x/control/t script; instead, I had "sv once x" (to avoid restarting x when
it exited), followed by "sv 1 x" and "sv force-stop x".

This had the effect of _starting_ x if it was down already (with sv once),
which brought y up again.

Wouldn't it be useful to have an 'sv once' style command that doesn't start
the service, merely causes it not to be restarted when it exits, provided it
is running?

Andras

-- 
 Andras Korn 
  QOTD:
  Money isn't everything... but it's not a bad start.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#441316: sv once ineffective if 'finish' exists and is executable

2007-09-11 Thread Andras Korn
On Mon, Sep 10, 2007 at 12:27:39PM +, Gerrit Pape wrote:

Hi,

> > if ./finish exists and is executable, runsv will execute it and then 
> > restart 
> > the service even if it was in the 'sv once' state.
> 
> Hmm, it doesn't fail for me
> [...]
> Can you post the exact commands to reproduce the issue?

Yes, will do. Very busy today, so probably tomorrow.

Thanks

Andras

-- 
 Andras Korn 
  QOTD:
  Santa's business model: 1. make toys. 2. give them away. 3. ??? 4. profit.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#441316: sv once ineffective if 'finish' exists and is executable

2007-09-10 Thread Gerrit Pape
On Sat, Sep 08, 2007 at 05:06:42PM +0200, Andras Korn wrote:
> if ./finish exists and is executable, runsv will execute it and then restart 
> the service even if it was in the 'sv once' state.

Hmm, it doesn't fail for me

 $ mkdir service && cd $_
 $ printf '#!/bin/sh\nexec sleep 7' >run && chmod 755 run
 $ printf '#!/bin/sh\nexec sleep 7' >finish && chmod 755 finish
 $ runsv . &
 [2] 29987
 $ sv stop .
 ok: down: .: 0s, normally up
 $ sv once .
 $ sv stat . && sleep 7 && sv stat . && sleep 7 && sv stat .
 run: .: (pid 30068) 1s, want down
 finish: .: (pid 30087) 8s, want down
 down: .: 1s, normally up
 $ sv start .
 ok: run: .: (pid 30108) 0s
 $ sv once .
 $ sv stat . && sleep 7 && sv stat . && sleep 7 && sv stat .
 run: .: (pid 30108) 3s, want down
 finish: .: (pid 30112) 11s, want down
 down: .: 4s, normally up
 $ 

Can you post the exact commands to reproduce the issue?

Thanks, Gerrit.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#441316: sv once ineffective if 'finish' exists and is executable

2007-09-08 Thread Andras Korn
Package: runit
Version: 1.7.2-1
Severity: normal

Hi,

if ./finish exists and is executable, runsv will execute it and then restart 
the service even if it was in the 'sv once' state.

Andras

-- System Information:
Debian Release: 4.0
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.20.13-vs2.2.0-chardonnay
Locale: LANG=POSIX, LC_CTYPE=hu_HU (charmap=ISO-8859-2)

runit depends on no packages.

Versions of packages runit recommends:
pn  fgetty (no description available)

-- no debconf information

-- 
 Andras Korn 
  QOTD:
  A printer consists of a case, a jammed paper tray and a blinking red light.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]