]> git.pld-linux.org Git - packages/PolicyKit.git/commitdiff
- init script
authorPatryk Zawadzki <patrys@room-303.com>
Tue, 5 Dec 2006 21:25:57 +0000 (21:25 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    PolicyKit.init -> 1.1

PolicyKit.init [new file with mode: 0755]

diff --git a/PolicyKit.init b/PolicyKit.init
new file mode 100755 (executable)
index 0000000..d6a9d2d
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# haldaemon    HAL daemon
+#
+# chkconfig:   345 95 05
+#
+# description: This is a daemon for collecting and maintaing information \
+#               about hardware from several sources. \
+#               See http://www.freedesktop.org/software/hal
+#
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+start() {
+       # First step: check for running messagebus service
+       if [ -f /var/lock/subsys/messagebus ]; then
+               # Check if the service is already running?
+               if [ ! -f /var/lock/subsys/PolicyKit ]; then
+                   msg_starting PolicyKit
+                   daemon polkitd
+                   RETVAL=$?
+                   [ $RETVAL -eq 0 ] && touch /var/lock/subsys/PolicyKit
+               else
+                   msg_already_running PolicyKit
+               fi
+       else
+               msg_not_running messagebus
+       fi
+}
+
+stop() {
+       if [ -f /var/lock/subsys/PolicyKit ]; then
+               # Stop daemons.
+               msg_stopping PolicyKit
+               killproc polkitd
+               rm -f /var/lock/subsys/PolicyKit
+       else
+               msg_not_running PolicyKit
+       fi
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  reload|force-reload)
+       if [ -f /var/lock/subsys/PolicyKit ]; then
+               msg_reloading PolicyKit
+               killproc polkitd -HUP
+               RETVAL=$?
+       else
+               msg_not_running PolicyKit
+               RETVAL=7
+       fi
+       ;;
+  status)
+       status polkitd
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh
This page took 0.121735 seconds and 4 git commands to generate.