summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-cluster/slurm/files/slurmdbd.initd')
-rw-r--r--sys-cluster/slurm/files/slurmdbd.initd33
1 files changed, 28 insertions, 5 deletions
diff --git a/sys-cluster/slurm/files/slurmdbd.initd b/sys-cluster/slurm/files/slurmdbd.initd
index c8512c516293..9a012c704cac 100644
--- a/sys-cluster/slurm/files/slurmdbd.initd
+++ b/sys-cluster/slurm/files/slurmdbd.initd
@@ -1,33 +1,56 @@
#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmdbd.initd,v 1.2 2011/07/04 10:15:30 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmdbd.initd,v 1.3 2012/04/18 13:53:03 alexxy Exp $
-opts="reload"
+extra_commands="reload"
[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm
depend() {
local _need="net"
[[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged"
+ [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind"
after logger
need ${_need}
}
+create_folder_and_set_permission() {
+ folder=${1}
+ # Fix permissions (/tmp is wiped at boot)
+ if [[ "${folder}" == "/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /tmp"
+ exit
+ fi
+ if [[ "${folder}" == "/var/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /var/tmp"
+ exit
+ fi
+ checkpath -d -o slurm:slurm ${folder}
+}
+
checkconfig() {
if [ ! -e "/etc/slurm/slurmdbd.conf" ]; then
eerror "Missing config /etc/slurm/slurmdbd.conf"
return 1
fi
+
+ # Make sure folders exists
+ . /etc/slurm/slurm.conf
+ folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation})
+ for folder in ${folders[*]}; do
+ create_folder_and_set_permission ${folder}
+ done
}
start() {
ebegin "Starting slurmdb daemon"
+ checkconfig
start-stop-daemon --start --quiet --background \
- --pidfile /var/run/slurm/slurmddb.pid \
+ --pidfile /var/run/slurm/slurmdbd.pid \
--user slurm \
--group slurm \
- --exec /usr/sbin/slurmddb -- ${SLURMD_OPTS}
+ --exec /usr/sbin/slurmdbd -- ${SLURMD_OPTS}
eend $?
}