source: trunk/torque-server.init @ 44

Last change on this file since 44 was 44, checked in by dennis, 14 years ago

Now torque_2_deb creates 8 packages just like the torque in the debian repository.

This has been done to fix a depedency problem of libopenmpi1.3 when we used our
previous build of torque.

File size: 1.7 KB
Line 
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:          torque-server
4# Required-Start:    $remote_fs $local_fs $named $network $time
5# Required-Stop:     $remote_fs $local_fs $named $network
6# Default-Start:     2 3 4 5
7# Default-Stop:      0 1 6
8# Short-Description: Start and stop the PBS server
9# Description:       PBS is a versatile batch system for SMPs and clusters.
10#                    This script controls the server process.
11### END INIT INFO
12
13PATH=/usr/sbin:/usr/bin:/sbin:/bin
14
15DAEMON=/usr/sbin/pbs_server
16NAME=torque-server
17DESC="Torque batch queue server"
18PIDFILE=/var/spool/torque/server_priv/server.lock
19
20test -x $DAEMON || exit 0
21
22# Include torque defaults if available
23if [ -f /etc/default/torque-server ]; then
24        . /etc/default/torque-server
25elif [ -f /etc/default/torque ]; then
26        . /etc/default/torque
27fi
28
29# Load lsb functions
30. /lib/lsb/init-functions
31
32case "$1" in
33  start)
34        log_daemon_msg "Starting $DESC"
35
36        if [ ! -r /var/spool/torque/server_priv/serverdb ]; then
37                DAEMON_SERVER_OPTS="-t create $DAEMON_SERVER_OPTS"
38        fi
39        log_progress_msg "$NAME"
40        start-stop-daemon --start --quiet --pidfile $PIDFILE \
41                --exec $DAEMON -- $DAEMON_SERVER_OPTS
42        log_end_msg $?
43        ;;
44
45  stop)
46        log_daemon_msg "Stopping $DESC" "$NAME"
47        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
48                --exec $DAEMON
49        log_end_msg $?
50        ;;
51
52  reload|force-reload)
53        log_daemon_msg "Reloading $DESC configuration files" "$NAME"
54        start-stop-daemon --stop --signal 1 --quiet \
55                --pidfile $PIDFILE --exec $DAEMON
56        log_end_msg $?
57  ;;
58
59  restart)
60        $0 stop && sleep 2 && $0 start
61        ;;
62
63  *)
64        N=/etc/init.d/`basename $0`
65        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
66        exit 1
67        ;;
68esac
69
70exit 0
Note: See TracBrowser for help on using the repository browser.