3 # description: SLURM is a simple resource management system which \
4 # manages exclusive access to a set of compute \
5 # resources and distributes work to those resources.
7 # processname: /usr/sbin/slurmd
8 # pidfile: /run/slurmd.pid
10 # processname: /usr/sbin/slurmctld
11 # pidfile: /run/slurmctld.pid
13 # config: /etc/default/slurm
22 if [ ! -f /etc
/rc.conf
]; then
23 echo "Could not find /etc/rc.conf. Are we using ARCH linux?"
28 # Source function library.
29 if [ ! -f /etc
/rc.d
/functions
]; then
30 echo "Could not find /etc/rc.d/functions. Is some other daemon launch mechanism used?"
37 function rc_status
() {
46 if [ ! -x $BINDIR/scontrol
]; then
47 echo "Could not find $BINDIR/scontrol. Bad path?"
51 # Source slurm specific configuration
52 # SLURMCTLD_OPTIONS defines slurmctld command line options. See "man slurmctld"
53 # SLURMD_OPTIONS defines slurmd command line options. See "man slurmd"
54 if [ -f /etc
/default
/slurm
] ; then
61 if [ ! -f $CONFDIR/slurm.conf
]; then
62 echo "Could not find $CONFDIR/slurm.conf. Bad path?"
66 # setup library paths for slurm and munge support
67 export LD_LIBRARY_PATH
=$LIBDIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
72 stat_busy
"Starting $prog"
73 unset HOME MAIL USER USERNAME
84 stat_busy
"Stopping $prog"
85 PID
=`pidof -o %PPID $prog`
86 [ "$PID" ] && kill $PID &> /dev
/null
96 for prog
in `$BINDIR/scontrol show daemons`; do
97 optvar
=`echo ${prog}_OPTIONS | tr "a-z" "A-Z"`
98 start
$prog ${!optvar}
103 # status() with slight modifications to take into account
104 # instantiations of job manager slurmd's, which should not be
105 # counted as "running"
113 pidfile
=`grep -i ${base}pid $CONFDIR/slurm.conf | grep -v '^ *#'`
115 pidfile
=${pidfile##*=}
116 pidfile
=${pidfile%#*}
118 pidfile
=/run
/${base}.pid
121 pid
=`pidof -o $$ -o $$PPID -o %PPID -x $1 || \
122 pidof -o $$ -o $$PPID -o %PPID -x ${base}`
124 if [ -f $pidfile ]; then
126 if [ "$rpid" != "" -a "$pid" != "" ]; then
128 if [ "$i" = "$rpid" ]; then
129 echo $
"${base} (pid $pid) is running..."
133 elif [ "$rpid" != "" -a "$pid" = "" ]; then
134 # Due to change in user id, pid file may persist
135 # after slurmctld terminates
136 if [ "$base" != "slurmctld" ] ; then
137 echo $
"${base} dead but pid file exists"
139 echo $
"${base} is stopped"
146 if [ "$base" = "slurmctld" -a "$pid" != "" ] ; then
147 echo $
"${base} (pid $pid) is running..."
151 echo $
"${base} is stopped"
157 # stop slurm daemons,
158 # wait for termination to complete (up to 10 seconds) before returning
161 for prog
in `$BINDIR/scontrol show daemons`; do
176 # The pathname substitution in daemon command assumes prefix and
177 # exec_prefix are same. This is the default, unless the user requests
180 # Any node can be a slurm controller and/or server.
187 SLURMCTLD_OPTIONS
="-c $SLURMCTLD_OPTIONS"
188 SLURMD_OPTIONS
="-c $SLURMD_OPTIONS"
195 for prog
in `$BINDIR/scontrol show daemons`; do
204 if [ -f /var
/lock
/subsys
/slurm
]; then
205 for prog
in `$BINDIR/scontrol show daemons`; do
212 for prog
in `$BINDIR/scontrol show daemons`; do
217 for prog
in `$BINDIR/scontrol show daemons`; do
218 echo "$prog runs here"
222 echo "Usage: $0 {start|startclean|stop|status|restart|reconfig|condrestart|test}"