[Pommed-commits] r424 - trunk

jblache at alioth.debian.org jblache at alioth.debian.org
Wed Dec 12 10:51:16 UTC 2007


Author: jblache
Date: 2007-12-12 10:51:16 +0000 (Wed, 12 Dec 2007)
New Revision: 424

Added:
   trunk/pommed.init
Modified:
   trunk/INSTALL
Log:
Add an init script.


Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2007-12-12 10:33:44 UTC (rev 423)
+++ trunk/INSTALL	2007-12-12 10:51:16 UTC (rev 424)
@@ -48,6 +48,9 @@
  - install pommed/data/KDE_Beep_Beep.wav as /usr/share/pommed/beep.wav
  - install pommed/data/goutte.wav as /usr/share/pommed/goutte.wav
  - copy pommed.conf.(mactel|pmac) as /etc/pommed.conf
+ - install the pommed.init initscript as /etc/init.d/pommed, make it executable
+   and perform any additional configuration needed on your system (links to
+   /etc/rc?.d/ for instance)
  - configure DBus for pommed
     + if you have a /etc/dbus-1/system.d directory, copy dbus-policy.conf
       as /etc/dbus-1/system.d/pommed.conf

Added: trunk/pommed.init
===================================================================
--- trunk/pommed.init	                        (rev 0)
+++ trunk/pommed.init	2007-12-12 10:51:16 UTC (rev 424)
@@ -0,0 +1,85 @@
+#! /bin/sh
+#
+# $Id$
+#
+### BEGIN INIT INFO
+# Provides:          pommed
+# Required-Start:    $syslog $local_fs
+# Required-Stop:     $syslog $local_fs
+# Should-Start:      
+# Should-Stop:       
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Apple laptops hotkeys event handler
+# Description:       pommed handles the hotkeys found on the Apple MacBook Pro
+#                    and MacBook laptops and adjusts the LCD backlight, sound
+#                    volume, keyboard backlight or ejects the CD-ROM drive
+#                    accordingly.
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/pommed
+NAME=pommed
+DESC="Apple laptops hotkeys events handler"
+
+test -x $DAEMON || exit 0
+
+set -e
+
+pommed_start()
+{
+    $DAEMON
+}
+
+pommed_stop()
+{
+    pid=$(cat /var/run/pommed.pid)
+    kill $pid
+    rm -f /var/run/pommed.pid
+}
+
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	pommed_start
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	if [ -f /var/run/pommed.pid ]; then
+	    pommed_stop
+	    echo "$NAME."
+	else
+	    echo "no PID file found; $NAME not running?"
+	fi
+	;;
+  force-reload)
+	# check wether $DAEMON is running. If so, restart
+	if [ -f /var/run/pommed.pid ]; then
+	    $0 restart
+	else
+	    echo "Reloading $DESC: $NAME not running."
+	    exit 0
+	fi
+	;;
+  restart)
+	echo -n "Restarting $DESC: "
+	if [ -f /var/run/pommed.pid ]; then
+	    pommed_stop
+	else
+	    echo "no PID file found; $NAME not running?"
+	    exit 0
+	fi
+	sleep 1
+	pommed_start
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0


Property changes on: trunk/pommed.init
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Id




More information about the Pommed-commits mailing list