summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2012-04-18 13:53:04 +0000
committerAlexey Shvetsov <alexxy@gentoo.org>2012-04-18 13:53:04 +0000
commit5bfd5c7961908c5d5e40fde4172398b15429cf99 (patch)
treeda084a191e1dea0f9941cfbe4be16219f2322c4f /sys-cluster/slurm/files
parentsys-boot/plymouth-openrc-plugin: Dropped aidecoe's maintainership. (diff)
downloadgentoo-2-5bfd5c7961908c5d5e40fde4172398b15429cf99.tar.gz
gentoo-2-5bfd5c7961908c5d5e40fde4172398b15429cf99.tar.bz2
gentoo-2-5bfd5c7961908c5d5e40fde4172398b15429cf99.zip
[sys-cluster/slurm] Version bump. Fix bug #410087 Thanks to Daniel M. Weeks. Also incorporate changes from bug #385871. Thanks to Nicolas Bigaouette
(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)
Diffstat (limited to 'sys-cluster/slurm/files')
-rw-r--r--sys-cluster/slurm/files/logrotate20
-rw-r--r--sys-cluster/slurm/files/slurm.confd1
-rw-r--r--sys-cluster/slurm/files/slurmctld.initd31
-rw-r--r--sys-cluster/slurm/files/slurmd.initd32
-rw-r--r--sys-cluster/slurm/files/slurmdbd.initd33
5 files changed, 105 insertions, 12 deletions
diff --git a/sys-cluster/slurm/files/logrotate b/sys-cluster/slurm/files/logrotate
new file mode 100644
index 000000000000..978a869eb993
--- /dev/null
+++ b/sys-cluster/slurm/files/logrotate
@@ -0,0 +1,20 @@
+/var/log/slurm/*.log {
+ weekly
+ compress
+ missingok
+ nocopytruncate
+ nocreate
+ nodelaycompress
+ nomail
+ notifempty
+ noolddir
+ rotate 5
+ sharedscripts
+ size=5M
+ create 640 slurm slurm
+ postrotate
+ /etc/init.d/slurmd reload
+ /etc/init.d/slurmctld reload
+ /etc/init.d/slurmdbd reload
+ endscript
+}
diff --git a/sys-cluster/slurm/files/slurm.confd b/sys-cluster/slurm/files/slurm.confd
index 13b69146e921..c406dc3f2a2c 100644
--- a/sys-cluster/slurm/files/slurm.confd
+++ b/sys-cluster/slurm/files/slurm.confd
@@ -3,3 +3,4 @@ SLURMCTLD_OPTIONS=""
SLURMDBD_OPTIONS=""
SLURMD_OPTIONS=""
SLURM_USE_MUNGE="0"
+SLURM_USE_YPBIND="0" \ No newline at end of file
diff --git a/sys-cluster/slurm/files/slurmctld.initd b/sys-cluster/slurm/files/slurmctld.initd
index 133aaa62923d..75cb21ef28fb 100644
--- a/sys-cluster/slurm/files/slurmctld.initd
+++ b/sys-cluster/slurm/files/slurmctld.initd
@@ -1,19 +1,34 @@
#!/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/slurmctld.initd,v 1.2 2011/07/04 10:15:30 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmctld.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"
- after logger
+ [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind"
+ after logger slurmdbd
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/slurm.conf" ]; then
eerror "Missing config /etc/slurm/slurm.conf"
@@ -21,10 +36,18 @@ checkconfig() {
eerror "in slurm doc directory"
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 slurm control daemon"
+ checkconfig
start-stop-daemon --start --quiet --background \
--pidfile /var/run/slurm/slurmctld.pid \
--user slurm \
diff --git a/sys-cluster/slurm/files/slurmd.initd b/sys-cluster/slurm/files/slurmd.initd
index a1a4be242759..a3ce9a92c7ad 100644
--- a/sys-cluster/slurm/files/slurmd.initd
+++ b/sys-cluster/slurm/files/slurmd.initd
@@ -1,19 +1,34 @@
#!/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/slurmd.initd,v 1.3 2011/07/04 10:15:30 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmd.initd,v 1.4 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/slurm.conf" ]; then
eerror "Missing config /etc/slurm/slurm.conf"
@@ -21,10 +36,21 @@ checkconfig() {
eerror "in slurm doc directory"
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 slurm daemon"
+ checkconfig
+ # Slurm does not propagate limits, which can brakes InfiniBand
+ # See http://www.open-mpi.org/faq/?category=openfabrics
+ # and https://computing.llnl.gov/linux/slurm/faq.html#rlimit
+ ulimit -l unlimited
start-stop-daemon --start --quiet --background \
--pidfile /var/run/slurm/slurmd.pid \
--user root \
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 $?
}