home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20120521.etc.tar.gz / bradford.20120521.etc.tar / etc / init.d / campusMgr < prev    next >
Text File  |  2007-01-23  |  3KB  |  119 lines

  1. #! /bin/sh
  2. # Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany.
  3. # All rights reserved.
  4. #
  5. # Author: Kurt Garloff <feedback@suse.de>
  6. #
  7. # /etc/init.d/FOO
  8. #
  9. #   and symbolic its link
  10. #
  11. # /(usr/)sbin/rcFOO
  12. #
  13. # LSB compliant service control script; see http://www.linuxbase.org/spec/
  14. # System startup script for some example service or daemon FOO (template)
  15. #
  16. ### BEGIN INIT INFO
  17. # Provides: campusMgr
  18. # Required-Start: mysql tomcat
  19. # Required-Stop:  $remote_fs $syslog
  20. # Default-Start:  3 5
  21. # Default-Stop:   0 1 2 6
  22. # Description:    Start Campus Manager
  23. ### END INIT INFO
  24. # Note on Required-Start: It does specify the init script ordering,
  25. # not real dependencies. Depencies have to be handled by admin
  26. # resp. the configuration tools (s)he uses.
  27.  
  28. # Source SuSE config (if still necessary, most info has been moved)
  29. # test -r /etc/rc.config && . /etc/rc.config
  30. . /bsc/campusMgr/bin/.yams
  31. echo $YAMS_DIST
  32.  
  33. # Shell functions sourced from /etc/rc.status:
  34. #      rc_check         check and set local and overall rc status
  35. #      rc_status        check and set local and overall rc status
  36. #      rc_status -v     ditto but be verbose in local rc status
  37. #      rc_status -v -r  ditto and clear the local rc status
  38. #      rc_failed        set local and overall rc status to failed
  39. #      rc_failed <num>  set local and overall rc status to <num><num>
  40. #      rc_reset         clear local rc status (overall remains)
  41. #      rc_exit          exit appropriate to overall rc status
  42. #      rc_active    checks whether a service is activated by symlinks
  43. . /etc/rc.status
  44.  
  45. # First reset status of this service
  46. rc_reset
  47.  
  48. # Return values acc. to LSB for all commands but status:
  49. # 0 - success
  50. # 1 - generic or unspecified error
  51. # 2 - invalid or excess argument(s)
  52. # 3 - unimplemented feature (e.g. "reload")
  53. # 4 - insufficient privilege
  54. # 5 - program is not installed
  55. # 6 - program is not configured
  56. # 7 - program is not running
  57. # Note that starting an already running service, stopping
  58. # or restarting a not-running service as well as the restart
  59. # with force-reload (in case signalling is not supported) are
  60. # considered a success.
  61.  
  62. case "$1" in
  63.     start)
  64.     echo -n "Starting Campus Manager"
  65.     ## Start daemon with startproc(8). If this fails
  66.     ## the echo return value is set appropriate.
  67.  
  68.     # NOTE: startproc returns 0, even if service is 
  69.     # already running to match LSB spec.
  70.         $YAMS_DIST/bin/startupCampusMgr
  71.  
  72.  
  73.     # Remember status and be verbose
  74.     rc_status -v
  75.     ;;
  76.     stop)
  77.     echo -n "Shutting down Campus Manager"
  78.     ## Stop daemon with killproc(8) and if this fails
  79.     ## set echo the echo return value.
  80.         $YAMS_DIST/bin/shutdownCampusMgr -kill
  81.  
  82.     # Remember status and be verbose
  83.     rc_status -v
  84.     ;;
  85.     restart)
  86.     ## Stop the service and regardless of whether it was
  87.     ## running or not, start it again.
  88.     $0 stop
  89.     $0 start
  90.  
  91.     # Remember status and be quiet
  92.     rc_status
  93.     ;;
  94.     status)
  95.     echo -n "Checking for service Campus Manager: "
  96.     ## Check status with checkproc(8), if process is running
  97.     ## checkproc will return with exit status 0.
  98.  
  99.     # Return value is slightly different for the status command:
  100.     # 0 - service running
  101.     # 1 - service dead, but /var/run/  pid  file exists
  102.     # 2 - service dead, but /var/lock/ lock file exists
  103.     # 3 - service not running
  104.  
  105.     # NOTE: checkproc returns LSB compliant status values.
  106.         $YAMS_DIST/bin/checkCampusMgr
  107.  
  108.     rc_status -v
  109.     ;;
  110.     *)
  111.     echo "Usage: $0 {start|stop|status|restart}"
  112.     exit 1
  113.     ;;
  114. esac
  115. rc_exit
  116.