[kernel] r7649 - people/jurij/ipw3945-daemon/debian

Jurij Smakov jurij-guest at costa.debian.org
Thu Oct 26 06:26:22 UTC 2006


Author: jurij-guest
Date: Thu Oct 26 06:26:20 2006
New Revision: 7649

Added:
   people/jurij/ipw3945-daemon/debian/logrotate
   people/jurij/ipw3945-daemon/debian/start   (contents, props changed)
   people/jurij/ipw3945-daemon/debian/stop   (contents, props changed)
Removed:
   people/jurij/ipw3945-daemon/debian/default
   people/jurij/ipw3945-daemon/debian/init
Modified:
   people/jurij/ipw3945-daemon/debian/dirs
   people/jurij/ipw3945-daemon/debian/postinst

Log:
Switch to starting/stopping by modprobe,
remove init script, add logging and log
handling, remove the default file.


Modified: people/jurij/ipw3945-daemon/debian/dirs
==============================================================================
--- people/jurij/ipw3945-daemon/debian/dirs	(original)
+++ people/jurij/ipw3945-daemon/debian/dirs	Thu Oct 26 06:26:20 2006
@@ -1 +1,2 @@
 var/run/ipw3945-daemon
+var/log/ipw3945-daemon

Added: people/jurij/ipw3945-daemon/debian/logrotate
==============================================================================
--- (empty file)
+++ people/jurij/ipw3945-daemon/debian/logrotate	Thu Oct 26 06:26:20 2006
@@ -0,0 +1,4 @@
+/var/log/ipw3945-daemon/ipw3945d.log {
+    rotate 6
+    weekly
+}

Modified: people/jurij/ipw3945-daemon/debian/postinst
==============================================================================
--- people/jurij/ipw3945-daemon/debian/postinst	(original)
+++ people/jurij/ipw3945-daemon/debian/postinst	Thu Oct 26 06:26:20 2006
@@ -5,6 +5,7 @@
     adduser --quiet --system --no-create-home --force-badname \
             --group Debian-ipw3945d
     chown Debian-ipw3945d:Debian-ipw3945d /var/run/ipw3945-daemon
+    chown Debian-ipw3945d:Debian-ipw3945d /var/log/ipw3945-daemon
     #DEBHELPER#
     ;;
   abort-upgrade|abort-remove|abort-deconfigure)

Added: people/jurij/ipw3945-daemon/debian/start
==============================================================================
--- (empty file)
+++ people/jurij/ipw3945-daemon/debian/start	Thu Oct 26 06:26:20 2006
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+DAEMON_PID='/var/run/ipw3945-daemon/ipw3945d.pid'
+DAEMON_LOG='/var/log/ipw3945-daemon/ipw3945d.log
+
+test -x /sbin/ipw3945d || exit 0
+
+# Wait for the devices to come up
+for delay in 1 2 4 
+do
+  cmd="$(echo /sys/bus/pci/drivers/ipw3945/*/cmd)"
+  test -n "${cmd}" && break
+  sleep ${delay}
+done
+# Try one last time, abort if the devices did not appear
+cmd="$(echo /sys/bus/pci/drivers/ipw3945/*/cmd)"
+test -n "${cmd}" || exit 1
+
+# Fix permissions
+chown Debian-ipw3945d:Debian-ipw3945d ${cmd}
+chmod 744 ${cmd}
+
+# If we are started early, the fs might be not mounted rw yet,
+# so we wait for it to become writable.
+while true
+do
+  if touch "${DAEMON_PID}"; then
+    rm -f "${DAEMON_PID}"
+    break
+  fi
+  sleep 1
+done
+
+# Launch the daemon
+su -s /bin/sh -c /sbin/ipw3945d "${DAEMON_USER}" -- --pid-file=${DAEMON_PID}" \
+                                                    --log-file=${DAEMON_LOG}" \
+                                                    --quiet

Added: people/jurij/ipw3945-daemon/debian/stop
==============================================================================
--- (empty file)
+++ people/jurij/ipw3945-daemon/debian/stop	Thu Oct 26 06:26:20 2006
@@ -0,0 +1,17 @@
+#!/bin/sh
+# This script must exit with a non-zero exit status,
+# because it is called as 'stop || modprobe -r ipw3945',
+# so we must assure that modprobe command runs always,
+# irrespectively of whether the script is present or not
+# (the "removed but not purged" situation")
+
+DAEMON_PID='/var/run/ipw3945-daemon/ipw3945d.pid'
+
+test -x /sbin/ipw3945d || exit 1
+
+/sbin/ipw3945d --kill --quiet --pid-file=${DAEMON_PID}
+
+# Cleanup the PID file, if it was left behind
+test -f "${DAEMON_PID}" && rm -f "${DAEMON_PID}"
+
+exit 1



More information about the Kernel-svn-changes mailing list