[Pvfs2-cvs] commit by dcypher in pvfs2/examples: pvfs2-server.rc
CVS commit program
cvs at parl.clemson.edu
Tue Sep 20 10:37:44 EDT 2011
Update of /projects/cvsroot/pvfs2/examples
In directory parlweb1:/tmp/cvs-serv24134
Added Files:
pvfs2-server.rc
Log Message:
Not sure why this was removed from the repository, but I'm adding this
example init script back.
--- /dev/null 2004-06-24 14:04:38.000000000 -0400
+++ pvfs2-server.rc 2011-09-20 10:37:42.000000000 -0400
@@ -0,0 +1,85 @@
+#!/bin/sh
+#
+# description: pvfs2-server is the server component of PVFS2
+#
+# chkconfig: 345 35 55
+
+### BEGIN INIT INFO
+# Provides: pvfs2-server
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 3 4 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Start pvfs2-server at boot time
+# Description: Enable access to pvfs2 filesystems.
+### END INIT INFO
+
+# Source function library.
+# Not sure what is supposed to be in this non-existant directory. --Jason
+#. /etc/rc.d/init.d/functions
+
+# set these if you want to hard code the location of the config files:
+PVFS2_FS_CONF=
+
+# override this if your server binary resides elsewhere
+PVFS2SERVER=/usr/local/sbin/pvfs2-server
+
+# override this if you want servers to automatically pick a conf file,
+# but you just need to specify what directory they are in
+PVFS2_CONF_PATH=/etc
+
+# the server will record its PID in this file
+PVFS2_PIDFILE=/var/run/pvfs2.pid
+
+# This is the location the script will store it's lock files.
+PVFS2_LOCK_FILE=/var/lock/pvfs2-server
+
+# verify presence of server binary
+if ! [ -x ${PVFS2SERVER} ]; then
+ echo "Error: could not find executable ${PVFS2SERVER}"
+ exit 1
+fi
+
+# look for fs conf
+if test "x$PVFS2_FS_CONF" = x
+then
+ PVFS2_FS_CONF=${PVFS2_CONF_PATH}/pvfs2-fs.conf
+fi
+if ! [ -r ${PVFS2_FS_CONF} ]; then
+ echo "Error: could not read ${PVFS2_FS_CONF}"
+ exit 1
+fi
+
+# See how we were called.
+case "$1" in
+ start)
+ echo -n "Starting PVFS2 server: "
+ exec ${PVFS2SERVER} ${PVFS2_FS_CONF}
+ echo `pidof ${PVFS2SERVER}` > ${PVFS2_PIDFILE}
+ echo
+ touch ${PVFS2_LOCK_FILE}
+ ;;
+ stop)
+ echo -n "Stopping PVFS2 server: "
+ kill `cat $PVFS2_PIDFILE`
+ echo
+ rm -f ${PVFS2_LOCK_FILE}
+ echo
+ rm -f ${PVFS2_PIDFILE}
+ ;;
+ status)
+ status pvfs2-server
+ ;;
+ restart)
+ $0 stop
+ # give server time to die cleanly
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
+
+exit 0
+
More information about the Pvfs2-cvs
mailing list