tags 715512 + patch
quit
On Tue, Jul 09, 2013 at 09:01:27PM +0000, Jamie Heilman wrote:
> This is pretty unlikely to happen in normal usage, but I ran across it
> doing some testing of "sv status" behaviors; if sv is given multiple
> service directories to operate on, and some of them don't have an
> active runsv process "sv status" may report misleading information:
>
> Given two service directories:
>
> # ls testapp1
> run supervise
> # ls testapp2
> log run supervise
>
> where testapp1 is running, and testapp2 isn't:
>
> # sv status ./testapp1
> run: ./testapp1: (pid 3682) 408178s
> # sv status ./testapp2
> fail: ./testapp2: runsv not running
> # sv status ./testapp1 ./testapp2
> run: ./testapp1: (pid 3682) 408184s
> fail: ./testapp2: runsv not running
> run: ./testapp2: (pid 3682) 408184sfail: ./testapp2: runsv not running
>
> That third line is the issue, afaics it shouldn't exist at all.
Thanks a lot for the report, it's a typo in the source since ages.
Here's a patch.
Regards, Gerrit.
diff --git a/runit-2.1.1/src/sv.c b/runit-2.1.1/src/sv.c
index e27ccb2..cea2487 100644
--- a/runit-2.1.1/src/sv.c
+++ b/runit-2.1.1/src/sv.c
@@ -153,7 +153,7 @@ int status(char *unused) {
int rc;
rc =svstatus_get();
- switch(r) { case -1: if (lsb) done(4); case 0: return(0); }
+ switch(rc) { case -1: if (lsb) done(4); case 0: return(0); }
rc =svstatus_print(*service);
if (chdir("log") == -1) {
if (errno != error_noent) {
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]