Le 17 juil. 09 à 11:08, Gerrit Pape a écrit : > Mathieu Poumeyrol zoy.org> writes: >> Le 13 juil. 09 à 16:13, Mathieu Poumeyrol a écrit : >>> Le 13 juil. 09 à 15:42, Charlie Brady a écrit : >>> It's not explicit here, but required for LSB compliance. >>> >>> see > http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/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 > timeout > or trouble sending the command. 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. > > 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 correct. The problem I exhibited and tracked is only visible for services that use a logging script, as the function that will change the value of 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