summaryrefslogtreecommitdiff
path: root/sysutils/slurm-wlm/files/slurmctld.in
blob: 5199e48b23bc3a6f4dd141c1efefb0fb2df2d594 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

# PROVIDE: slurmctld
# REQUIRE: DAEMON munge
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# slurmctld_enable (bool):   Set to NO by default.
#               Set it to YES to enable slurmctld.
#

. /etc/rc.subr

name="slurmctld"
rcvar=slurmctld_enable

pidfile=/var/run/$name.pid

load_rc_config $name

: ${slurmctld_enable="NO"}

start_cmd=slurmctld_start
stop_cmd=slurmctld_stop

slurmctld_start() {
    checkyesno slurmctld_enable && echo "Starting $name." && \
	%%PREFIX%%/sbin/$name $slurmctld_flags
}

slurmctld_stop() {
    if [ -e $pidfile ]; then
        checkyesno slurmctld_enable && echo "Stopping $name." && \
	    kill `cat $pidfile`
    else
	killall $name
    fi
}

run_rc_command "$1"