SOURCES: ConsoleKit.init (NEW) - new based on one provided by Cons...

czarny czarny at pld-linux.org
Wed Mar 14 17:40:18 CET 2007


Author: czarny                       Date: Wed Mar 14 16:40:18 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new based on one provided by ConsoleKit

---- Files affected:
SOURCES:
   ConsoleKit.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ConsoleKit.init
diff -u /dev/null SOURCES/ConsoleKit.init:1.1
--- /dev/null	Wed Mar 14 17:40:18 2007
+++ SOURCES/ConsoleKit.init	Wed Mar 14 17:40:13 2007
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# ConsoleKit: ConsoleKit daemon
+#
+# chkconfig: 345 96 4
+# description: The ConsoleKit maintains a list of sessions
+#
+# processname: console-kit-daemon
+# pidfile: /var/run/ConsoleKit/pid
+#
+
+# Sanity checks.
+[ -x /usr/sbin/console-kit-daemon ] || exit 0
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# so we can rearrange this easily
+processname=console-kit-daemon
+servicename=ConsoleKit
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/$servicename ]; then
+		msg_starting $servicename
+		daemon $processname
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
+	else
+		msg_already_running $servicename
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/$servicename ]; then
+		# Stop daemons.
+		msg_stopping $servicename
+		killproc $processname
+		rm -f /var/lock/subsys/$servicename
+	else
+		msg_not_running $servicename
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	exit $?
+	;;
+  reload)
+  	reload
+	;;
+  force-reload)
+	# if program allows reloading without stopping
+	reload
+
+	# or if it doesn't
+	stop
+	start
+	;;
+  status)
+	status $processname
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list