16
16
### BEGIN INIT INFO
18
# Required-Start: $local_fs $syslog $network $named munge
19
# Required-Stop: $local_fs $syslog $network $named munge
21
# Default-Stop: 0 1 2 6
18
# Required-Start: $remote_fs $syslog $network munge
19
# Required-Stop: $remote_fs $syslog $network munge
20
# Should-Start: $named
22
# Default-Start: 2 3 4 5
22
24
# Short-Description: slurm daemon management
23
25
# Description: Start slurm to provide resource management
89
91
if [ "$1" = "slurmd" ] ; then
90
certfile=$(grep JobCredentialPublicCertificate $CONFDIR/slurm.conf \
92
keyfile=$(grep JobCredentialPublicCertificate $CONFDIR/slurm.conf \
92
certfile=${certfile##*=}
93
certfile=${certfile%#*}
94
[ -e $certfile ] || MISSING="$certfile"
94
keyfile=${keyfile##*=}
96
[ -e $keyfile ] || MISSING="$keyfile"
95
97
elif [ "$1" = "slurmctld" ] ; then
96
98
keyfile=$(grep JobCredentialPrivateKey $CONFDIR/slurm.conf | grep -v "^ *#")
97
99
keyfile=${keyfile##*=}
103
105
echo Not starting slurm-llnl
104
106
echo $MISSING not found
105
107
echo Please follow the instructions in \
106
/usr/share/doc/slurm-llnl/README.Debian
108
/usr/share/doc/slurm-llnl/README.cryptotype-openssl
110
if [ -f $keyfile ] ; then
112
if [ -f "$keyfile" ] && [ "$1" = "slurmctld" ] ; then
111
113
keycheck=$(openssl-vulnkey $keyfile | cut -d : -f 1)
112
114
if [ "$keycheck" = "COMPROMISED" ] ; then
115
115
echo Your slurm key stored in the file $keyfile
116
116
echo is vulnerable because has been created with a buggy openssl.
117
117
echo Please rebuild it with openssl version \>= 0.9.8g-9
140
140
CRYPTOTYPE=$(grep CryptoType $CONFDIR/slurm.conf | grep -v "^ *#")
141
141
CRYPTOTYPE=${CRYPTOTYPE##*=}
142
142
CRYPTOTYPE=${CRYPTOTYPE%#*}
143
if [ "$CRYPTOTYPE" = "crypto/openssl" ] || [ "$CRYPTOTYPE" = "" ] ; then
143
if [ "$CRYPTOTYPE" = "crypto/openssl" ] ; then
147
# Create run-time variable data
148
mkdir -p /var/run/slurm-llnl
149
chown slurm:slurm /var/run/slurm-llnl
151
# Checking if SlurmdSpoolDir is under run
152
if [ "$1" = "slurmd" ] ; then
153
SDIRLOCATION=$(grep SlurmdSpoolDir /etc/slurm-llnl/slurm.conf \
155
SDIRLOCATION=${SDIRLOCATION##*=}
156
SDIRLOCATION=${SDIRLOCATION%#*}
157
if [ "${SDIRLOCATION}" = "/var/run/slurm-llnl/slurmd" ] ; then
158
if ! [ -e /var/run/slurm-llnl/slurmd ] ; then
159
ln -s /var/lib/slurm-llnl/slurmd /var/run/slurm-llnl/slurmd
164
# Checking if StateSaveLocation is under run
165
if [ "$1" = "slurmctld" ] ; then
166
SDIRLOCATION=$(grep StateSaveLocation /etc/slurm-llnl/slurm.conf \
168
SDIRLOCATION=${SDIRLOCATION##*=}
169
SDIRLOCATION=${SDIRLOCATION%#*}
170
if [ "${SDIRLOCATION}" = "/var/run/slurm-llnl/slurmctld" ] ; then
171
if ! [ -e /var/run/slurm-llnl/slurmctld ] ; then
172
ln -s /var/lib/slurm-llnl/slurmctld /var/run/slurm-llnl/slurmctld
147
177
desc="$(get_daemon_description $1)"
148
178
log_daemon_msg "Starting $desc" "$1"
149
179
unset HOME MAIL USER USERNAME
225
255
# Due to change in user id, pid file may persist
226
256
# after slurmctld terminates
227
257
if [ "$base" != "slurmctld" ] ; then
228
echo $"${base} dead but pid file exists"
258
echo "${base} dead but pid file exists"
235
265
if [ "$base" = "slurmctld" -a "$pid" != "" ] ; then
236
echo $"${base} (pid $pid) is running..."
266
echo "${base} (pid $pid) is running..."
240
echo $"${base} is stopped"
270
echo "${base} is stopped"