From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1964 Path: news.gmane.org!not-for-mail From: Mathieu Poumeyrol Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Bug for sv status in lsb mode Date: Fri, 17 Jul 2009 12:02:05 +0200 Message-ID: <74FC29D4-E338-49E2-8461-91BDD25FAD67@zoy.org> References: <8F9355C5-C168-4AD7-8B6C-502416E7EECC@zoy.org> <94175859-2733-4ACF-85E9-DD5FF627F23B@zoy.org> <17A739BC-94BA-4611-A523-6978934F0D61@zoy.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: multipart/alternative; boundary=Apple-Mail-1--1065214374 X-Trace: ger.gmane.org 1247824942 460 80.91.229.12 (17 Jul 2009 10:02:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jul 2009 10:02:22 +0000 (UTC) Cc: supervision@list.skarnet.org To: Gerrit Pape Original-X-From: supervision-return-2199-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Jul 17 12:02:14 2009 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1MRkGa-0008Pv-Vc for gcsg-supervision@gmane.org; Fri, 17 Jul 2009 12:02:13 +0200 Original-Received: (qmail 28812 invoked by uid 76); 17 Jul 2009 10:03:26 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 28800 invoked from network); 17 Jul 2009 10:03:26 -0000 In-Reply-To: X-Mailer: Apple Mail (2.935.3) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1964 Archived-At: --Apple-Mail-1--1065214374 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Le 17 juil. 09 =E0 11:08, Gerrit Pape a =E9crit : > Mathieu Poumeyrol zoy.org> writes: >> Le 13 juil. 09 =E0 16:13, Mathieu Poumeyrol a =E9crit : >>> Le 13 juil. 09 =E0 15:42, Charlie Brady a =E9crit : >>> It's not explicit here, but required for LSB compliance. >>> >>> see > = http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-gene= ric/iniscrptact.html >>> >>> As a matter of fact, sv code looks like it is meant to achieve this, >>> but fails because of the side effect on the "r" global. >> >> Sorry, it is actually explicit in the "Exit codes" last paragraph... >> >> If the command is status, it exits 3 if the service is down, and 4 if >> the status is unknown. It exits 2 on wrong usage, and 151 on error. > > Hi, this is a bug in the documentation then, the complete paragraph is > > If sv is called with a base name other than sv, it exits 1 on =20 > timeout > or trouble sending the command. If the command is status, it =20 > exits 3 > if the service is down, and 4 if the status is unknown. It exits 2 =20= > on > wrong usage, and 151 on error. > > These exit codes only apply if sv is called with a different basename. > > # sv stop getty-5 > ok: down: getty-5: 0s, normally up > # ln -s $(which sv) /tmp/getty-5 > # /tmp/getty-5 status > down: getty-5: 4s, normally up > # echo $? > 3 > # > > Any suggestions on how to improve the man page? Hello, the man page is fine. And I aggree the behaviour you demounstrate is =20 correct. The problem I exhibited and tracked is only visible for services that =20= use a logging script, as the function that will change the value of =20 the "r" global is only called if the service has a logging service... # tree /etc/service/that-one-does-not-work /etc/service/that-one-does-not-work |-- log | |-- main | | |-- current | | `-- lock | |-- run | `-- supervise | |-- control | |-- lock | |-- ok | |-- pid | |-- stat | `-- status |-- run `-- supervise |-- control |-- lock |-- ok |-- pid |-- stat `-- status # ./that-one-does-not-work status ; echo $? down: that-one-does-not: 8s, normally up; run: log: (pid 11444) 37s 0= --Apple-Mail-1--1065214374--