#!/sbin/runscript # # description: pvfs2-server is the server component of PVFS2 # 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 # look for server conf if test "x$PVFS2_SERVER_CONF" = x then #determine hostname if test "x$HOSTNAME" = x then HOSTNAME=`hostname` fi THIS_HOSTNAME=`echo $HOSTNAME | cut -d '.' -f 1` if test "x$THIS_HOSTNAME" = xlocalhost then echo "Warning: detected hostname as localhost, may confuse PVFS2 startup" fi PVFS2_SERVER_CONF=${PVFS2_CONF_PATH}/pvfs2-server.conf-${THIS_HOSTNAME} fi if ! [ -r ${PVFS2_SERVER_CONF} ]; then echo "Error: could not read ${PVFS2_SERVER_CONF}" exit 1 fi depend() { after localmount netmount nfsmount dns use net } start() { ebegin "Starting PVFS2 server" start-stop-daemon --start --quiet --background \ --pidfile ${PVFS2_PIDFILE} --make-pidfile \ --exec ${PVFS2SERVER} -- ${PVFS2_FS_CONF} ${PVFS2_SERVER_CONF} ${PVFS2_OPTIONS} touch /var/lock/subsys/pvfs2-server eend $? "Error starting PVFS2 server" } stop() { ebegin "Stopping PVFS2 server" start-stop-daemon --stop --quiet --pidfile ${PVFS2_PIDFILE} eend $? "Error stopping PVFS2 server" rm -f /var/lock/subsys/pvfs2-server }