Package: uptimed
Version: 1:0.3.16-3.2~ah
Severity: wishlist
Tags: patch

Please consider renaming /etc/init.d/uptimed.sh to something else,
because I think it's confusing that it has such a similar name
to /etc/init.d/uptimed and systemd doesn't like it either, see bug #600092.

I'm including a patch for your convenience... It uses the name uptimed-init
instead of uptimed.sh as suggested in the systemd bug discussion...

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (300, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages uptimed depends on:
ii  debconf [debconf-2.0]       1.5.41       Debian configuration management sy
ii  libc6                       2.13-13      Embedded GNU C Library: Shared lib
ii  libuptimed0                 1:0.3.16-3.1 Library for uptimed

uptimed recommends no packages.

uptimed suggests no packages.

-- Configuration Files:
/etc/uptimed.conf changed [not included]

-- debconf information excluded
>From 1f309076cfa728d71b51d8c2c679bf4c4892df7e Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <andr...@fatal.se>
Date: Thu, 4 Aug 2011 12:36:18 +0200
Subject: [PATCH 3/8] Rename uptimed.sh to uptimed-init to avoid breaking
 systemd

Rename /etc/init.d/uptimed.sh to avoid confusion with /etc/init.d/uptimed.
This avoids confusing systemd..... See http://bugs.debian.org/600092
---
 debian/rules                     |    2 +-
 debian/uptimed.postinst          |    6 +++++-
 debian/uptimed.postrm            |    4 ++++
 debian/uptimed.preinst           |   11 +++++++++++
 debian/uptimed.uptimed-init.init |   28 ++++++++++++++++++++++++++++
 debian/uptimed.uptimed.sh.init   |   28 ----------------------------
 6 files changed, 49 insertions(+), 30 deletions(-)
 create mode 100644 debian/uptimed.preinst
 create mode 100644 debian/uptimed.uptimed-init.init
 delete mode 100644 debian/uptimed.uptimed.sh.init

diff --git a/debian/rules b/debian/rules
index be56ef1..2d2ebac 100755
--- a/debian/rules
+++ b/debian/rules
@@ -103,7 +103,7 @@ binary-arch: build install
 #      dh_installpam -a
 #      dh_installmime -a
        dh_installinit -a -- defaults 99
-       dh_installinit -a --name=uptimed.sh --no-start -- start 60 S .
+       dh_installinit -a --name=uptimed-init --no-start -- start 60 S .
 #      dh_installcron -a
        dh_installman -a
 #      dh_installinfo -a
diff --git a/debian/uptimed.postinst b/debian/uptimed.postinst
index 0438fa5..6c7eba5 100644
--- a/debian/uptimed.postinst
+++ b/debian/uptimed.postinst
@@ -54,7 +54,7 @@ if [ "$1" = "configure" ]; then
                 if [ ! -d /var/spool/uptimed ]; then
                         mkdir /var/spool/uptimed
                 fi
-                /etc/init.d/uptimed.sh start
+                /etc/init.d/uptimed-init start
         fi
         if [ "$NEEDRESTART" = "yes" ]; then
                 /etc/init.d/uptimed restart-if-running
@@ -69,4 +69,8 @@ fi
        chown root:daemon /etc/uptimed.conf
        chmod 644 /etc/uptimed.conf
 
+if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
+       dpkg-maintscript-helper mv_conffile /etc/init.d/uptimed.sh 
/etc/init.d/uptimed-init 1:0.3.16-3.1 -- "$@"
+fi
+
 #DEBHELPER#
diff --git a/debian/uptimed.postrm b/debian/uptimed.postrm
index 8c60f08..071291b 100644
--- a/debian/uptimed.postrm
+++ b/debian/uptimed.postrm
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
+       dpkg-maintscript-helper mv_conffile /etc/init.d/uptimed.sh 
/etc/init.d/uptimed-init 1:0.3.16-3.1 -- "$@"
+fi
+
 #DEBHELPER#
 
 if [ "$1" = "purge" ]; then
diff --git a/debian/uptimed.preinst b/debian/uptimed.preinst
new file mode 100644
index 0000000..dac9ad7
--- /dev/null
+++ b/debian/uptimed.preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# migrate /etc/init.d/uptimed.sh (last shipped in 0.3.16-3.1)
+# to /etc/init.d/uptimed-init and remove rcS.d/S*uptimed link
+# (postinst will install the new link)
+if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
+       update-rc.d -f uptimed.sh remove
+       dpkg-maintscript-helper mv_conffile /etc/init.d/uptimed.sh 
/etc/init.d/uptimed-init 1:0.3.16-3.1 -- "$@"
+fi
+
+#DEBHELPER#
diff --git a/debian/uptimed.uptimed-init.init b/debian/uptimed.uptimed-init.init
new file mode 100644
index 0000000..9a4d91f
--- /dev/null
+++ b/debian/uptimed.uptimed-init.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          uptimed-init
+# Required-Start:    $remote_fs
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Uptime daemon initialization
+### END INIT INFO
+
+# /etc/init.d/uptimed-init: initialize uptimed
+
+test -x /usr/sbin/uptimed || exit 0
+
+case "$1" in
+    start)
+       /usr/sbin/uptimed -b
+        ;;
+
+    stop|force-reload|restart)
+        ;;
+
+    *)
+        echo "Usage: $0 {start|stop|restart|force-reload}"
+        exit 1
+esac
+
+exit 0
diff --git a/debian/uptimed.uptimed.sh.init b/debian/uptimed.uptimed.sh.init
deleted file mode 100644
index 1495961..0000000
--- a/debian/uptimed.uptimed.sh.init
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:          uptimed-init
-# Required-Start:    $remote_fs
-# Required-Stop:
-# Default-Start:     S
-# Default-Stop:
-# Short-Description: Uptime daemon initialization
-### END INIT INFO
-
-# /etc/init.d/uptimed.sh: initialize uptimed
-
-test -x /usr/sbin/uptimed || exit 0
-
-case "$1" in
-    start)
-       /usr/sbin/uptimed -b
-        ;;
-
-    stop|force-reload|restart)
-        ;;
-
-    *)
-        echo "Usage: $0 {start|stop|restart|force-reload}"
-        exit 1
-esac
-
-exit 0
-- 
1.7.5.4

Reply via email to