From da71d1359c1335997595935dbaa07c5747231861 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 1 Mar 2009 05:35:18 -0800 Subject: Added proper handling for the init scripts for (Debian, Ubuntu, SuSE, Redhat), SuSE init script also added. * Init scripts added for Debian, Redhat, SuSE distribution, each are installed by checking each distribution specific. Tested on 1. Debian, Ubuntu. 2. Redhat, CentOS. 3. OpenSUSE. Signed-off-by: Anand V. Avati --- extras/init.d/glusterfs-server | 100 ----------------------------------------- 1 file changed, 100 deletions(-) delete mode 100755 extras/init.d/glusterfs-server (limited to 'extras/init.d/glusterfs-server') diff --git a/extras/init.d/glusterfs-server b/extras/init.d/glusterfs-server deleted file mode 100755 index 975283982b2..00000000000 --- a/extras/init.d/glusterfs-server +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: glusterfsd -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: gluster server -# Description: This file starts / stops the gluster server -### END INIT INFO - -# Author: Chris AtLee -# Patched by: Matthias Albert < matthias@linux4experts.de> - -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=glusterfsd -SCRIPTNAME=/etc/init.d/$NAME -DAEMON=/usr/sbin/$NAME -PIDFILE=/var/run/$NAME.pid -CONFIGFILE=/etc/glusterfs/server.vol -GLUSTERFS_OPTS="-f $CONFIGFILE" -PID=`test -f $PIDFILE && cat $PIDFILE` - - -# Gracefully exit if the package has been removed. -test -x $DAEMON || exit 0 - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -. /lib/lsb/init-functions - -check_config() -{ - if [ ! -f "$CONFIGFILE" ]; then - echo "Config file $CONFIGFILE is missing...exiting!" - exit 0 - fi -} - -do_start() -{ - check_config; - pidofproc -p $PIDFILE $DAEMON >/dev/null - status=$? - if [ $status -eq 0 ]; then - log_success_msg "glusterfs server is already running with pid $PID" - else - log_daemon_msg "Starting glusterfs server" "glusterfsd" - start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $GLUSTERFS_OPTS - log_end_msg $? - start_daemon -p $PIDFILE $DAEMON -f $CONFIGFILE - return $? - fi -} - -do_stop() -{ - log_daemon_msg "Stopping glusterfs server" "glusterfsd" - start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE - log_end_msg $? - rm -f $PIDFILE - killproc -p $PIDFILE $DAEMON - return $? -} - -do_status() -{ - pidofproc -p $PIDFILE $DAEMON >/dev/null - status=$? - if [ $status -eq 0 ]; then - log_success_msg "glusterfs server is running with pid $PID" - else - log_failure_msg "glusterfs server is not running." - fi - exit $status -} - -case "$1" in - start) - do_start - ;; - stop) - do_stop - ;; - status) - do_status; - ;; - restart|force-reload) - do_stop - sleep 2 - do_start - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -- cgit