home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / examples / pvfs2-server.rc.in
Text File  |  2007-12-07  |  1KB  |  67 lines

  1. #!/bin/sh
  2. #
  3. # description: pvfs2-server is the server component of PVFS2
  4. #
  5. # chkconfig: 345 35 55
  6.  
  7. # Source function library.
  8. . /etc/rc.d/init.d/functions
  9.  
  10. # set these if you want to hard code the location of the config files:
  11. PVFS2_FS_CONF=
  12. # override this if your server binary resides elsewhere
  13. PVFS2SERVER=@prefix@/sbin/pvfs2-server
  14. # override this if you want servers to automatically pick a conf file,
  15. #   but you just need to specify what directory they are in
  16. PVFS2_CONF_PATH=/etc
  17.  
  18. # the server will record its PID in this file
  19. PVFS2_PIDFILE=/var/run/pvfs2.pid
  20.  
  21. # verify presence of server binary
  22. if ! [ -x ${PVFS2SERVER} ]; then
  23.     echo "Error: could not find executable ${PVFS2SERVER}"
  24.     exit 1
  25. fi
  26.  
  27. # look for fs conf
  28. if test "x$PVFS2_FS_CONF" = x
  29. then
  30.     PVFS2_FS_CONF=${PVFS2_CONF_PATH}/pvfs2-fs.conf
  31. fi
  32. if ! [ -r ${PVFS2_FS_CONF} ]; then
  33.     echo "Error: could not read ${PVFS2_FS_CONF}"
  34.     exit 1
  35. fi
  36.  
  37. # See how we were called.
  38. case "$1" in
  39.   start)
  40.     echo -n "Starting PVFS2 server: "
  41.     daemon ${PVFS2SERVER} --pidfile ${PVFS2_PIDFILE} ${PVFS2_FS_CONF}
  42.     echo
  43.     touch /var/lock/subsys/pvfs2-server
  44.     ;;
  45.   stop)
  46.     echo -n "Stopping PVFS2 server: "
  47.     kill `cat /var/run/pvfs2.pid`
  48.     echo
  49.     rm -f /var/lock/subsys/pvfs2-server
  50.     ;;
  51.   status)
  52.         status pvfs2-server
  53.     ;;
  54.   restart)
  55.     $0 stop
  56.     # give server time to die cleanly
  57.     sleep 2
  58.     $0 start
  59.     ;;
  60.   *)
  61.     echo "Usage: $0 {start|stop|status|restart}"
  62.     exit 1
  63. esac
  64.  
  65. exit 0
  66.  
  67.