Bug#565631: lsb-base: status_of_proc

"Didier 'OdyX' Raboud" <[email protected]>
Newsgroups gmane.linux.debian.devel.lsb
Organization Debian, the Universal OS
Message-ID <4F5732A7.1090907__10216.2593430423$1331117030$gmane$org@debian.org>
tags 565631 +patch
thanks

Le 17.01.2010 15:58, Thomas Koch a écrit :
> Package: lsb-base
> Version: 3.2-23
> Severity: normal
> 
> status_of_proc is not documented. You may want to provide documentation
> in /usr/share/doc/lsb-base/README.Debian

Hi Thomas, and thanks for your bugreport,

I propose the attached patch for review and comments.

(I also put Dustin Kirkland, initiator of the status_of_proc function in
Debian/Ubuntu's lsb-base, in explicit CC.)

Opinions ?

Cheers,

OdyX
0001-lsb-base.README.Debian-Document-status_of_proc.patch (text/plain, 1.9 KB)
From c5ddfe0154ae0ce5b11dbb5c37f429c40901e026 Mon Sep 17 00:00:00 2001
From: Didier Raboud <[email protected]>
Date: Wed, 7 Mar 2012 10:56:25 +0100
Subject: [PATCH] lsb-base.README.Debian: Document status_of_proc.

Closes: #565631
Reported-by: Thomas Koch <[email protected]>
Signed-off-by: Didier Raboud <[email protected]>
---
 debian/lsb-base.README.Debian |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/debian/lsb-base.README.Debian b/debian/lsb-base.README.Debian
index 360ae21..c10d827 100644
--- a/debian/lsb-base.README.Debian
+++ b/debian/lsb-base.README.Debian
@@ -68,6 +68,35 @@ specific to Debian and (in some cases) other derived distributions.
     Note that unlike log_end_msg(), this function does not return the
     first argument as its exit code.
 
+  - status_of_proc [-p pidfile] pathname "Daemon_name"
+
+    Log the status of a process and return an LSB-compliant exit status
+    code:
+
+    0       program is running or service is OK
+    1       program is dead and /var/run pid file exists
+    2       program is dead and /var/lock lock file exists
+    3       program is not running
+    4       program or service status is unknown
+    5-99    reserved for future LSB use
+    100-149 reserved for distribution use
+    150-199 reserved for application use
+    200-254 reserved
+
+    On Debian, outputs:
+      "Daemon_name is running.".
+      "Daemon_name is not running ... failed!"
+
+    The pidfile path will be used as argument for pidofproc and must be
+    provided if the pidfile is not /var/run/$daemon_basename.pid.
+
+    status_of_proc can be used to easily implement the "status" argument
+    of init scripts:
+
+      status)
+        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+      ;;
+
 A deprecated function, log_start_msg, is also provided for
 compatibility with a few older packages and a derived distribution.
 This may eventually disappear.
-- 
1.7.2.5
signature.asc (application/pgp-signature, 663 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQGcBAEBAgAGBQJPVzKoAAoJEIvPpx7KFjRVeXML/0WLgHRn6Tx+iLDdkdHK3/T8
aUslI+qXaCpzmn44UxTyvIn7+qRDHfC4b7NGbtsGJl4/xUBHFxDqQbHliDf4tRzE
1ZaFPpWbom2YdDM6jfekacu16kb22J+IfTk3qCRkEYKzTvU7TauTD4up67miDL8b
o+BLVORH1zJCatcFr1BbGLnLTLBsVWwY76pGFu6nCg122Lkz/NfHUDyp7p0SGjNp
W6SQQ16zBd46Dt7blaP0MjfzgNO4myZYrgFrCEyw+ILiU8ceLypom4jmVXMC7EhJ
m95eQ5n2GgfdOMR5xCSVA96Hgr6Qq/K/sGnHN9pFrArM0Lln5lt4CBDn4n+4uhuM
jgIDHcUIDBAuNsU4ZyPFExl8zo1XornzPy0M8/GfGD42rpnyg3T8EvdGmgnAnoSi
R4b4DZY9iHY2oJ8eCU6aDKazb7rUev8MH5HeZRrCcvbegCl2IM+mwgfFAR8qIQ6g
t12Cfmqr/GFgtzlFy32k7kKD9mv04tqcxx+txYArUQ==
=Tp0X
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.