SOURCES: glusterfsd.init (NEW) - Release 1. Added init.d script fo...
matkor
matkor at pld-linux.org
Fri Jan 4 16:40:17 CET 2008
Author: matkor Date: Fri Jan 4 15:40:17 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- Release 1. Added init.d script for launching glusterfsd.
---- Files affected:
SOURCES:
glusterfsd.init (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/glusterfsd.init
diff -u /dev/null SOURCES/glusterfsd.init:1.1
--- /dev/null Fri Jan 4 16:40:17 2008
+++ SOURCES/glusterfsd.init Fri Jan 4 16:40:12 2008
@@ -0,0 +1,119 @@
+#!/bin/sh
+#
+# glusterfsd GlusterFS Daemon
+#
+# chkconfig: 345 14 89
+#
+# description: GlusterFS Daemon
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+
+# Get service config - may override defaults
+# [ -f /etc/sysconfig/glusterfsd ] && . /etc/sysconfig/glusterfsd
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down glusterfsd
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+test -x /usr/sbin/glusterfsd || exit 0
+
+
+
+
+start() {
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/glusterfsd ]; then
+ msg_starting glusterfsd
+ daemon /usr/sbin/glusterfsd --pidfile=/var/run/glusterfsd.pid #
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/glusterfsd
+ else
+ msg_already_running glusterfsd
+ fi
+}
+
+stop() {
+ if [ -f /var/lock/subsys/glusterfsd ]; then
+ # Stop daemons.
+ msg_stopping glusterfsd
+ killproc glusterfsd
+ killproc --pidfile /var/run/glusterfsd.pid glusterfsd -TERM
+ rm -f /var/lock/subsys/glusterfsd
+ else
+ msg_not_running glusterfsd
+ fi
+}
+
+reload() {
+ if [ -f /var/lock/subsys/glusterfsd ]; then
+ msg_reloading glusterfsd
+ killproc glusterfsd -HUP
+ killproc --pidfile /var/run/glusterfsd.pid glusterfsd -HUP
+ RETVAL=$?
+ else
+ msg_not_running glusterfsd
+ RETVAL=7
+ fi
+}
+
+condrestart() {
+ if [ -f /var/lock/subsys/glusterfsd ]; then
+ stop
+ start
+ else
+ msg_not_running glusterfsd
+ RETVAL=$1
+ fi
+}
+
+
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+# include force-reload here if program allows reloading without restart
+# otherwise remove reload action and support force-reload as restart if running
+# reload|force-reload)
+# reload
+# ;;
+# use this one if program doesn't support reloading without restart
+# force-reload)
+# condrestart 7
+# ;;
+ status)
+ status glusterfsd
+ RETVAL=$?
+ ;;
+ *)
+ ## msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+ msg_usage "$0 {start|stop|restart|try-restart|status}"
+ exit 3
+esac
+
+exit $RETVAL
+
================================================================
More information about the pld-cvs-commit
mailing list