Bug#583802: xdm: init script should support the "status" option
On 2010-05-30 20:12 +0200, Sven Joachim wrote:
> Package: xdm
> Version: 1:1.1.10-1
> Severity: wishlist
>
> I just saw this during a libc6 upgrade:
>
> ,----
> | Vorbereiten zum Ersetzen von libc6 2.10.2-9 (durch .../libc6_2.11.1-1_i386.deb) ...
> | Checking for services that may need to be restarted...
> | Checking init scripts...
> | Usage: /etc/init.d/xdm {start|stop|restart|reload|force-reload}
> `----
>
> Apparently the libc6 preinst runs "invoke-rc.d xdm status" which is not
> currently supported.
Attached is a patch for this option that works for me. Or it would, if
it weren't for #545896:
,----
| $ /etc/init.d/xdm status
| xdm is running.
| $ /etc/init.d/rsync status
| could not access PID file for rsync ... failed!
`----
Nevertheless, I think the patch could be committed to git.
Sven
>From aa4525ec166476173ff9bc3acf3c8e21671b120b Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenjoac@gmx.de>
Date: Tue, 1 Jun 2010 09:05:00 +0200
Subject: [PATCH 1/2] xdm.init: Implement "status" option (Closes: #583802)
Bump dependency on lsb-base to 3.2-13 for status_of_proc().
---
debian/changelog | 5 +++++
debian/control | 2 +-
debian/xdm.init | 6 +++++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f20f0eb..2a8e553 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
xdm (1:1.1.10-2) UNRELEASED; urgency=low
+ [ Julien Cristau ]
* debian.diff: stop defining XDMAUTHDIR, it's not used anymore.
* debian.diff: replace references to the XFree86 X server with Xorg.
* Set default system and user PATHs when running configure instead of
@@ -7,6 +8,10 @@ xdm (1:1.1.10-2) UNRELEASED; urgency=low
* Drop obsolete upgrade code from pre-etch versions in preinst, postinst and
postrm scripts.
+ [ Sven Joachim ]
+ * xdm.init: Implement "status" option (Closes: #583802).
+ - Bump dependency on lsb-base to 3.2-13 for status_of_proc().
+
-- Julien Cristau <jcristau@debian.org> Tue, 20 Apr 2010 02:08:13 +0200
xdm (1:1.1.10-1) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 0864788..96751a3 100644
--- a/debian/control
+++ b/debian/control
@@ -30,7 +30,7 @@ Depends:
debconf (>= 1.2.9) | debconf-2.0,
x11-utils | xbase-clients | xmessage,
cpp,
- lsb-base (>= 3.0-6),
+ lsb-base (>= 3.2-13),
x11-xserver-utils,
procps,
Pre-Depends: x11-common (>= 1:7.0.0)
diff --git a/debian/xdm.init b/debian/xdm.init
index 93fcb62..4127dff 100644
--- a/debian/xdm.init
+++ b/debian/xdm.init
@@ -113,8 +113,12 @@ case "$1" in
log_end_msg 0
;;
+ status)
+ status_of_proc -p $PIDFILE $DAEMON xdm && exit 0 || exit $?
+ ;;
+
*)
- echo "Usage: /etc/init.d/xdm {start|stop|restart|reload|force-reload}"
+ echo "Usage: /etc/init.d/xdm {start|stop|restart|reload|force-reload|status}"
exit 1
;;
esac
--
1.7.1
Reply to: