| 1 | #!/bin/sh |
|---|
| 2 | # |
|---|
| 3 | # Maui Scheduler This script will start and stop the Maui Scheduler (SUSE) |
|---|
| 4 | # |
|---|
| 5 | ### BEGIN INIT INFO |
|---|
| 6 | # Provides: maui |
|---|
| 7 | # Required-Start: $syslog $remote_fs pbs_server |
|---|
| 8 | # Should-Start: |
|---|
| 9 | # Required-Stop: $syslog $remote_fs pbs_server |
|---|
| 10 | # Should-Stop: $null |
|---|
| 11 | # Default-Start: 3 4 5 |
|---|
| 12 | # Default-Stop: 0 1 2 6 |
|---|
| 13 | # Short-Description: Maui scheduler |
|---|
| 14 | # Description: Controls Maui - a dedicated scheduler for the Torque (PBS) batch system for SMPs and clusters. |
|---|
| 15 | ### END INIT INFO |
|---|
| 16 | # Source the library functions |
|---|
| 17 | . /etc/rc.status |
|---|
| 18 | |
|---|
| 19 | # ENVIRONMENT |
|---|
| 20 | MAUI=/usr/local/maui/sbin/maui |
|---|
| 21 | |
|---|
| 22 | # |
|---|
| 23 | # Check for parameters in /etc/sysconfig, |
|---|
| 24 | # if so load them into the environment |
|---|
| 25 | [ -f /etc/sysconfig/maui ] && . /etc/sysconfig/maui |
|---|
| 26 | |
|---|
| 27 | # |
|---|
| 28 | # make sure the binary exists |
|---|
| 29 | # exit if not |
|---|
| 30 | [ -x $MAUI ] || exit |
|---|
| 31 | |
|---|
| 32 | # |
|---|
| 33 | # What command are we to do? |
|---|
| 34 | # |
|---|
| 35 | case "$1" in |
|---|
| 36 | |
|---|
| 37 | start) |
|---|
| 38 | echo -n "Starting the Maui scheduler: " |
|---|
| 39 | startproc $MAUI |
|---|
| 40 | rc_status -v |
|---|
| 41 | ;; |
|---|
| 42 | |
|---|
| 43 | stop) |
|---|
| 44 | echo -n "Shutting down Maui Scheduler: " |
|---|
| 45 | killproc `basename $MAUI` |
|---|
| 46 | rc_status -v |
|---|
| 47 | ;; |
|---|
| 48 | |
|---|
| 49 | status) |
|---|
| 50 | checkproc `basename $MAUI` |
|---|
| 51 | rc_status -v |
|---|
| 52 | ;; |
|---|
| 53 | |
|---|
| 54 | restart) |
|---|
| 55 | $0 stop |
|---|
| 56 | $0 start |
|---|
| 57 | ;; |
|---|
| 58 | |
|---|
| 59 | *) |
|---|
| 60 | echo "Usage: maui {start|stop|restart|status}" |
|---|
| 61 | exit 1 |
|---|
| 62 | |
|---|
| 63 | esac |
|---|