summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-cluster/slurm/ChangeLog11
-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
-rw-r--r--sys-cluster/slurm/metadata.xml1
-rw-r--r--sys-cluster/slurm/slurm-2.2.7-r1.ebuild119
-rw-r--r--sys-cluster/slurm/slurm-2.2.7-r2.ebuild160
-rw-r--r--sys-cluster/slurm/slurm-2.3.3.ebuild153
-rw-r--r--sys-cluster/slurm/slurm-2.3.4.ebuild225
11 files changed, 341 insertions, 445 deletions
diff --git a/sys-cluster/slurm/ChangeLog b/sys-cluster/slurm/ChangeLog
index f93b515f4dea..4484aa0f979a 100644
--- a/sys-cluster/slurm/ChangeLog
+++ b/sys-cluster/slurm/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-cluster/slurm
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/ChangeLog,v 1.9 2012/03/15 22:09:57 alexxy Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/ChangeLog,v 1.10 2012/04/18 13:53:03 alexxy Exp $
+
+*slurm-2.3.4 (18 Apr 2012)
+
+ 18 Apr 2012; Alexey Shvetsov <alexxy@gentoo.org> +files/logrotate,
+ +slurm-2.3.4.ebuild, -slurm-2.2.7-r1.ebuild, -slurm-2.2.7-r2.ebuild,
+ -slurm-2.3.3.ebuild, files/slurm.confd, files/slurmctld.initd,
+ files/slurmd.initd, files/slurmdbd.initd, metadata.xml:
+ [sys-cluster/slurm] Version bump. Fix bug #410087 Thanks to Daniel M. Weeks.
+ Also incorporate changes from bug #385871. Thanks to Nicolas Bigaouette
15 Mar 2012; Alexey Shvetsov <alexxy@gentoo.org> slurm-2.3.3.ebuild:
Add missing dep
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 $?
}
diff --git a/sys-cluster/slurm/metadata.xml b/sys-cluster/slurm/metadata.xml
index 654f3e95a4d0..9882145f156b 100644
--- a/sys-cluster/slurm/metadata.xml
+++ b/sys-cluster/slurm/metadata.xml
@@ -8,6 +8,7 @@
<use>
<flag name='maui'>Enable maui scheduler support</flag>
<flag name='munge'>Enable authentication via munge</flag>
+ <flag name='ypbind'>Enable ypbind based auth</flag>
<flag name='torque'>Enable perl scripts that emulates pbs (qstat, qsub etc.)</flag>
</use>
</pkgmetadata>
diff --git a/sys-cluster/slurm/slurm-2.2.7-r1.ebuild b/sys-cluster/slurm/slurm-2.2.7-r1.ebuild
deleted file mode 100644
index 3e62f364ed90..000000000000
--- a/sys-cluster/slurm/slurm-2.2.7-r1.ebuild
+++ /dev/null
@@ -1,119 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/slurm-2.2.7-r1.ebuild,v 1.1 2011/08/31 15:32:17 alexxy Exp $
-
-EAPI=4
-
-inherit eutils pam
-
-DESCRIPTION="SLURM: A Highly Scalable Resource Manager"
-HOMEPAGE="https://computing.llnl.gov/linux/slurm/"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="maui +munge mysql pam postgres ssl static-libs"
-
-DEPEND="
- !sys-cluster/torque
- !net-analyzer/slurm
- mysql? ( dev-db/mysql )
- munge? ( sys-auth/munge )
- pam? ( virtual/pam )
- postgres? ( dev-db/postgresql-base )
- ssl? ( dev-libs/openssl )
- >=sys-apps/hwloc-1.1.1-r1"
-RDEPEND="${DEPEND}
- maui? ( sys-cluster/maui[slurm] )"
-
-pkg_setup() {
- enewgroup slurm 500
- enewuser slurm 500 -1 /var/spool/slurm slurm
-}
-
-src_prepare() {
- # gentoo uses /sys/fs/cgroup instead of /dev/cgroup
- sed -e 's:/dev/cgroup:/sys/fs/cgroup:g' \
- -i "${S}/doc/man/man5/cgroup.conf.5" \
- -i "${S}/etc/cgroup.conf.example" \
- -i "${S}/etc/cgroup.release_agent" \
- -i "${S}/src/plugins/proctrack/cgroup/xcgroup.h" \
- || die
- # and pids should go to /var/run/slurm
- sed -e 's:/var/run/slurmctld.pid:/var/run/slurm/slurmctld.pid:g' \
- -e 's:/var/run/slurmd.pid:/var/run/slurm/slurmd.pid:g' \
- -i "${S}/etc/slurm.conf.example"
- # also state dirs are in /var/spool/slurm
- sed -e 's:StateSaveLocation=/tmp:StateSaveLocation=/var/spool/slurm:g' \
- -e 's:SlurmdSpoolDir=/tmp/slurmd:SlurmdSpoolDir=/var/spool/slurm/slurmd:g' \
- -i "${S}/etc/slurm.conf.example"
-}
-
-src_configure() {
- local myconf=(
- --sysconfdir="${EPREFIX}/etc/${PN}"
- --with-hwloc="${EPREFIX}/usr"
- )
- use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
- use mysql || myconf+=( --without-mysql_config )
- use postgres || myconf+=( --without-pg_config )
- econf "${myconf[@]}" \
- $(use_enable pam) \
- $(use_with ssl) \
- $(use_with munge) \
- $(use_enable static-libs static)
-}
-
-src_compile() {
- default
- use pam && emake -C contribs/pam || die
-}
-
-src_install() {
- default
- emake DESTDIR="${D}" -C contribs/torque install || die
- use pam && emake DESTDIR="${D}" -C contribs/pam install || die
- use static-libs || find "${ED}" -name '*.la' -exec rm {} +
- # we dont need it
- rm "${ED}/usr/bin/mpiexec" || die
- # install sample configs
- keepdir /etc/slurm
- keepdir /var/log/slurm
- keepdir /var/spool/slurm
- keepdir /var/run/slurm
- insinto /etc/slurm
- doins etc/cgroup.conf.example
- doins etc/federation.conf.example
- doins etc/slurm.conf.example
- doins etc/slurmdbd.conf.example
- exeinto /etc/slurm
- doexe etc/cgroup.release_agent
- doexe etc/slurm.epilog.clean
- # install init.d files
- newinitd "${FILESDIR}/slurmd.initd" slurmd
- newinitd "${FILESDIR}/slurmctld.initd" slurmctld
- newinitd "${FILESDIR}/slurmdbd.initd" slurmdbd
- # install conf.d files
- newconfd "${FILESDIR}/slurm.confd" slurm
-}
-
-pkg_preinst() {
- if use munge; then
- sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/slurm || die
- fi
-}
-
-pkg_postinst() {
- einfo "Fixing permissions in /var/spool/${PN}"
- chown -R ${PN}:${PN} /var/spool/${PN}
- einfo "Fixing permissions in /var/run/${PN}"
- chown -R ${PN}:${PN} /var/run/${PN}
- einfo "Fixing permissions in /var/log/${PN}"
- chown -R ${PN}:${PN} /var/log/${PN}
- echo
-
- elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
- elog "through a (javascript enabled) browser to create a configureation file."
- elog "Copy that file to /etc/slurm.conf on all nodes (including the headnode) of your cluster."
-}
diff --git a/sys-cluster/slurm/slurm-2.2.7-r2.ebuild b/sys-cluster/slurm/slurm-2.2.7-r2.ebuild
deleted file mode 100644
index e4d6c9968ea5..000000000000
--- a/sys-cluster/slurm/slurm-2.2.7-r2.ebuild
+++ /dev/null
@@ -1,160 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/slurm-2.2.7-r2.ebuild,v 1.2 2011/10/26 16:00:57 alexxy Exp $
-
-EAPI=4
-
-inherit eutils pam perl-module
-
-DESCRIPTION="SLURM: A Highly Scalable Resource Manager"
-HOMEPAGE="https://computing.llnl.gov/linux/slurm/"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="maui +munge mysql pam +perl postgres ssl static-libs +torque"
-
-DEPEND="
- !net-analyzer/slurm
- mysql? ( dev-db/mysql )
- munge? ( sys-auth/munge )
- pam? ( virtual/pam )
- perl? ( perl-core/Switch )
- postgres? ( dev-db/postgresql-base )
- ssl? ( dev-libs/openssl )
- torque? ( !sys-cluster/torque )
- >=sys-apps/hwloc-1.1.1-r1
- "
-RDEPEND="${DEPEND}
- maui? ( sys-cluster/maui[slurm] )
- "
-
-REQUIRED_USE="torque? ( perl )"
-
-LIBSLURM_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurm/perl"
-LIBSLURMDB_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurmdb/perl"
-
-pkg_setup() {
- enewgroup slurm 500
- enewuser slurm 500 -1 /var/spool/slurm slurm
-}
-
-src_prepare() {
- # gentoo uses /sys/fs/cgroup instead of /dev/cgroup
- sed -e 's:/dev/cgroup:/sys/fs/cgroup:g' \
- -i "${S}/doc/man/man5/cgroup.conf.5" \
- -i "${S}/etc/cgroup.conf.example" \
- -i "${S}/etc/cgroup.release_agent" \
- -i "${S}/src/plugins/proctrack/cgroup/xcgroup.h" \
- || die
- # and pids should go to /var/run/slurm
- sed -e 's:/var/run/slurmctld.pid:/var/run/slurm/slurmctld.pid:g' \
- -e 's:/var/run/slurmd.pid:/var/run/slurm/slurmd.pid:g' \
- -i "${S}/etc/slurm.conf.example"
- # also state dirs are in /var/spool/slurm
- sed -e 's:StateSaveLocation=/tmp:StateSaveLocation=/var/spool/slurm:g' \
- -e 's:SlurmdSpoolDir=/tmp/slurmd:SlurmdSpoolDir=/var/spool/slurm/slurmd:g' \
- -i "${S}/etc/slurm.conf.example"
-}
-
-src_configure() {
- local myconf=(
- --sysconfdir="${EPREFIX}/etc/${PN}"
- --with-hwloc="${EPREFIX}/usr"
- )
- use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
- use mysql || myconf+=( --without-mysql_config )
- use postgres || myconf+=( --without-pg_config )
- econf "${myconf[@]}" \
- $(use_enable pam) \
- $(use_with ssl) \
- $(use_with munge) \
- $(use_enable static-libs static)
- if use perl ; then
- # small hack to make it compile
- mkdir -p "${S}/src/api/.libs"
- mkdir -p "${S}/src/db_api/.libs"
- touch "${S}/src/api/.libs/libslurm.so"
- touch "${S}/src/db_api/.libs/libslurmdb.so"
- cd "${LIBSLURM_PERL_S}"
- S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
- cd "${LIBSLURMDB_PERL_S}"
- S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
- cd "${S}"
- rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs"
- fi
-}
-
-src_compile() {
- default
- use pam && emake -C contribs/pam || die
- if use perl ; then
- cd "${LIBSLURM_PERL_S}"
- S="${LIBSLURM_PERL_S}" perl-module_src_compile
- cd "${LIBSLURMDB_PERL_S}"
- S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
- cd "${S}"
- fi
- if use torque ;then
- emake -C contribs/torque || die
- fi
-}
-
-src_install() {
- default
- emake DESTDIR="${D}" -C contribs/torque install || die
- use pam && emake DESTDIR="${D}" -C contribs/pam install || die
- if use perl; then
- cd "${LIBSLURM_PERL_S}"
- S="${LIBSLURM_PERL_S}" perl-module_src_install
- cd "${LIBSLURMDB_PERL_S}"
- S="${LIBSLURMDB_PERL_S}" perl-module_src_install
- cd "${S}"
- fi
- if use torque; then
- emake DESTDIR="${D}" -C contribs/torque || die
- fi
- use static-libs || find "${ED}" -name '*.la' -exec rm {} +
- # we dont need it
- rm "${ED}/usr/bin/mpiexec" || die
- # install sample configs
- keepdir /etc/slurm
- keepdir /var/log/slurm
- keepdir /var/spool/slurm
- keepdir /var/run/slurm
- insinto /etc/slurm
- doins etc/cgroup.conf.example
- doins etc/federation.conf.example
- doins etc/slurm.conf.example
- doins etc/slurmdbd.conf.example
- exeinto /etc/slurm
- doexe etc/cgroup.release_agent
- doexe etc/slurm.epilog.clean
- # install init.d files
- newinitd "${FILESDIR}/slurmd.initd" slurmd
- newinitd "${FILESDIR}/slurmctld.initd" slurmctld
- newinitd "${FILESDIR}/slurmdbd.initd" slurmdbd
- # install conf.d files
- newconfd "${FILESDIR}/slurm.confd" slurm
-}
-
-pkg_preinst() {
- if use munge; then
- sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/slurm || die
- fi
-}
-
-pkg_postinst() {
- einfo "Fixing permissions in /var/spool/${PN}"
- chown -R ${PN}:${PN} /var/spool/${PN}
- einfo "Fixing permissions in /var/run/${PN}"
- chown -R ${PN}:${PN} /var/run/${PN}
- einfo "Fixing permissions in /var/log/${PN}"
- chown -R ${PN}:${PN} /var/log/${PN}
- echo
-
- elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
- elog "through a (javascript enabled) browser to create a configureation file."
- elog "Copy that file to /etc/slurm.conf on all nodes (including the headnode) of your cluster."
-}
diff --git a/sys-cluster/slurm/slurm-2.3.3.ebuild b/sys-cluster/slurm/slurm-2.3.3.ebuild
deleted file mode 100644
index 2117e22b812b..000000000000
--- a/sys-cluster/slurm/slurm-2.3.3.ebuild
+++ /dev/null
@@ -1,153 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/slurm-2.3.3.ebuild,v 1.2 2012/03/15 22:09:57 alexxy Exp $
-
-EAPI=4
-
-inherit eutils pam perl-module
-
-DESCRIPTION="SLURM: A Highly Scalable Resource Manager"
-HOMEPAGE="https://computing.llnl.gov/linux/slurm/"
-SRC_URI="
- http://www.schedmd.com/download/latest/${P}.tar.bz2
- http://www.schedmd.com/download/archive/${P}.tar.bz2
- "
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="maui +munge mysql pam +perl postgres ssl static-libs +torque"
-
-DEPEND="
- !net-analyzer/slurm
- mysql? ( dev-db/mysql )
- munge? ( sys-auth/munge )
- pam? ( virtual/pam )
- perl? ( perl-core/Switch )
- postgres? ( dev-db/postgresql-base )
- ssl? ( dev-libs/openssl )
- torque? ( !sys-cluster/torque )
- >=sys-apps/hwloc-1.1.1-r1
- "
-RDEPEND="${DEPEND}
- dev-libs/libcgroup
- maui? ( sys-cluster/maui[slurm] )
- "
-
-REQUIRED_USE="torque? ( perl )"
-
-LIBSLURM_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurm/perl"
-LIBSLURMDB_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurmdb/perl"
-
-pkg_setup() {
- enewgroup slurm 500
- enewuser slurm 500 -1 /var/spool/slurm slurm
-}
-
-src_prepare() {
- # and pids should go to /var/run/slurm
- sed -e 's:/var/run/slurmctld.pid:/var/run/slurm/slurmctld.pid:g' \
- -e 's:/var/run/slurmd.pid:/var/run/slurm/slurmd.pid:g' \
- -i "${S}/etc/slurm.conf.example"
- # also state dirs are in /var/spool/slurm
- sed -e 's:StateSaveLocation=/tmp:StateSaveLocation=/var/spool/slurm:g' \
- -e 's:SlurmdSpoolDir=/tmp/slurmd:SlurmdSpoolDir=/var/spool/slurm/slurmd:g' \
- -i "${S}/etc/slurm.conf.example"
-}
-
-src_configure() {
- local myconf=(
- --sysconfdir="${EPREFIX}/etc/${PN}"
- --with-hwloc="${EPREFIX}/usr"
- )
- use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
- use mysql || myconf+=( --without-mysql_config )
- use postgres || myconf+=( --without-pg_config )
- econf "${myconf[@]}" \
- $(use_enable pam) \
- $(use_with ssl) \
- $(use_with munge) \
- $(use_enable static-libs static)
- if use perl ; then
- # small hack to make it compile
- mkdir -p "${S}/src/api/.libs"
- mkdir -p "${S}/src/db_api/.libs"
- touch "${S}/src/api/.libs/libslurm.so"
- touch "${S}/src/db_api/.libs/libslurmdb.so"
- cd "${LIBSLURM_PERL_S}"
- S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
- cd "${LIBSLURMDB_PERL_S}"
- S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
- cd "${S}"
- rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs"
- fi
-}
-
-src_compile() {
- default
- use pam && emake -C contribs/pam || die
- if use perl ; then
- cd "${LIBSLURM_PERL_S}"
- S="${LIBSLURM_PERL_S}" perl-module_src_compile
- cd "${LIBSLURMDB_PERL_S}"
- S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
- cd "${S}"
- fi
- if use torque ;then
- emake -C contribs/torque || die
- fi
-}
-
-src_install() {
- default
- emake DESTDIR="${D}" -C contribs/torque install || die
- use pam && emake DESTDIR="${D}" -C contribs/pam install || die
- if use perl; then
- cd "${LIBSLURM_PERL_S}"
- S="${LIBSLURM_PERL_S}" perl-module_src_install
- cd "${LIBSLURMDB_PERL_S}"
- S="${LIBSLURMDB_PERL_S}" perl-module_src_install
- cd "${S}"
- fi
- if use torque; then
- emake DESTDIR="${D}" -C contribs/torque || die
- fi
- use static-libs || find "${ED}" -name '*.la' -exec rm {} +
- # we dont need it
- rm "${ED}/usr/bin/mpiexec" || die
- # install sample configs
- keepdir /etc/slurm
- keepdir /var/log/slurm
- keepdir /var/spool/slurm
- keepdir /var/run/slurm
- insinto /etc/slurm
- doins etc/*.example
- exeinto /etc/slurm
- doexe etc/slurm.epilog.clean
- # install init.d files
- newinitd "${FILESDIR}/slurmd.initd" slurmd
- newinitd "${FILESDIR}/slurmctld.initd" slurmctld
- newinitd "${FILESDIR}/slurmdbd.initd" slurmdbd
- # install conf.d files
- newconfd "${FILESDIR}/slurm.confd" slurm
-}
-
-pkg_preinst() {
- if use munge; then
- sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/slurm || die
- fi
-}
-
-pkg_postinst() {
- einfo "Fixing permissions in /var/spool/${PN}"
- chown -R ${PN}:${PN} /var/spool/${PN}
- einfo "Fixing permissions in /var/run/${PN}"
- chown -R ${PN}:${PN} /var/run/${PN}
- einfo "Fixing permissions in /var/log/${PN}"
- chown -R ${PN}:${PN} /var/log/${PN}
- echo
-
- elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
- elog "through a (javascript enabled) browser to create a configureation file."
- elog "Copy that file to /etc/slurm.conf on all nodes (including the headnode) of your cluster."
-}
diff --git a/sys-cluster/slurm/slurm-2.3.4.ebuild b/sys-cluster/slurm/slurm-2.3.4.ebuild
new file mode 100644
index 000000000000..0297c626c5a4
--- /dev/null
+++ b/sys-cluster/slurm/slurm-2.3.4.ebuild
@@ -0,0 +1,225 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/slurm-2.3.4.ebuild,v 1.1 2012/04/18 13:53:03 alexxy Exp $
+
+RESTRICT="primaryuri"
+
+EAPI=4
+inherit eutils versionator pam perl-module
+
+MY_PV=$(replace_version_separator 3 '-') # stable releases
+#MY_PV=$(replace_version_separator 3 '-0.') # pre-releases
+MY_P="${PN}-${MY_PV}"
+MY_branch="latest"
+#MY_branch="development"
+
+DESCRIPTION="SLURM: A Highly Scalable Resource Manager"
+HOMEPAGE="https://computing.llnl.gov/linux/slurm/"
+SRC_URI="http://www.schedmd.com/download/${MY_branch}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="maui +munge mysql pam perl postgres ssl static-libs torque ypbind"
+
+DEPEND="
+ !sys-cluster/torque
+ !net-analyzer/slurm
+ mysql? ( dev-db/mysql )
+ munge? ( sys-auth/munge )
+ ypbind? ( net-nds/ypbind )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql-base )
+ ssl? ( dev-libs/openssl )
+ >=sys-apps/hwloc-1.1.1-r1"
+RDEPEND="${DEPEND}
+ maui? ( sys-cluster/maui[slurm] )"
+
+REQUIRED_USE="torque? ( perl )"
+
+S="${WORKDIR}/${MY_P}"
+
+LIBSLURM_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurm/perl"
+LIBSLURMDB_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurmdb/perl"
+
+pkg_setup() {
+ enewgroup slurm 500
+ enewuser slurm 500 -1 /var/spool/slurm slurm
+}
+
+src_prepare() {
+ # Gentoo uses /sys/fs/cgroup instead of /cgroup
+ # FIXME: Can the "^/cgroup" and "\([ =\"]\)/cgroup" patterns be merged?
+ sed \
+ -e 's|\([ =\"]\)/cgroup|\1/sys/fs/cgroup|g' \
+ -e "s|^/cgroup|/sys/fs/cgroup|g" \
+ -i "${S}/doc/man/man5/cgroup.conf.5" \
+ -i "${S}/etc/cgroup.release_common.example" \
+ -i "${S}/src/common/xcgroup_read_config.c" \
+ || die "Can't sed /cgroup for /sys/fs/cgroup"
+ # and pids should go to /var/run/slurm
+ sed -e 's:/var/run/slurmctld.pid:/var/run/slurm/slurmctld.pid:g' \
+ -e 's:/var/run/slurmd.pid:/var/run/slurm/slurmd.pid:g' \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed for /var/run/slurmctld.pid"
+ # also state dirs are in /var/spool/slurm
+ sed -e 's:StateSaveLocation=*.:StateSaveLocation=/var/spool/slurm:g' \
+ -e 's:SlurmdSpoolDir=*.:SlurmdSpoolDir=/var/spool/slurm/slurmd:g' \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed ${S}/etc/slurm.conf.example for StateSaveLocation=*. or SlurmdSpoolDir=*"
+ # and tmp should go to /var/tmp/slurm
+ sed -e 's:/tmp:/var/tmp:g' \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed for StateSaveLocation=*./tmp"
+}
+
+src_configure() {
+ local myconf=(
+ --sysconfdir="${EPREFIX}/etc/${PN}"
+ --with-hwloc="${EPREFIX}/usr"
+ --docdir="${EPREFIX}/usr/share/doc/${P}"
+ --htmldir="${EPREFIX}/usr/share/doc/${P}"
+ )
+ use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
+ use mysql || myconf+=( --without-mysql_config )
+ use postgres || myconf+=( --without-pg_config )
+ econf "${myconf[@]}" \
+ $(use_enable pam) \
+ $(use_with ssl) \
+ $(use_with munge) \
+ $(use_enable static-libs static)
+
+ # --htmldir does not seems to propagate... Documentations are installed
+ # in /usr/share/doc/slurm-2.3.0/html
+ # instead of /usr/share/doc/slurm-2.3.0.2/html
+ sed -e "s|htmldir = .*/html|htmldir = \${prefix}/share/doc/slurm-${PVR}/html|g" -i doc/html/Makefile || die
+ if use perl ; then
+ # small hack to make it compile
+ mkdir -p "${S}/src/api/.libs"
+ mkdir -p "${S}/src/db_api/.libs"
+ touch "${S}/src/api/.libs/libslurm.so"
+ touch "${S}/src/db_api/.libs/libslurmdb.so"
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${S}"
+ rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs"
+ fi
+}
+
+src_compile() {
+ default
+ use pam && emake -C contribs/pam || die
+ if use perl ; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" perl-module_src_compile
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
+ cd "${S}"
+ fi
+ if use torque ; then
+ emake -C contribs/torque || die
+ fi
+}
+
+src_install() {
+ default
+ use pam && emake DESTDIR="${D}" -C contribs/pam install || die
+ if use perl; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" perl-module_src_install
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_install
+ cd "${S}"
+ fi
+ if use torque; then
+ emake DESTDIR="${D}" -C contribs/torque || die
+ fi
+ use static-libs || find "${ED}" -name '*.la' -exec rm {} +
+ # we dont need it
+ rm "${ED}/usr/bin/mpiexec" || die
+ # install sample configs
+ keepdir /etc/slurm
+ insinto /etc/slurm
+ doins etc/cgroup.conf.example
+ doins etc/federation.conf.example
+ doins etc/slurm.conf.example
+ doins etc/slurmdbd.conf.example
+ exeinto /etc/slurm
+ doexe etc/cgroup.release_common.example
+ doexe etc/slurm.epilog.clean
+ # install init.d files
+ newinitd "${FILESDIR}/slurmd.initd" slurmd
+ newinitd "${FILESDIR}/slurmctld.initd" slurmctld
+ newinitd "${FILESDIR}/slurmdbd.initd" slurmdbd
+ # install conf.d files
+ newconfd "${FILESDIR}/slurm.confd" slurm
+ # Install logrotate file
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate" slurm || die
+ # cgroups support
+ exeinto /etc/slurm/cgroup
+ doexe etc/cgroup.release_common.example
+ mv "${D}"/etc/slurm/cgroup/cgroup.release_common.example "${D}"/etc/slurm/cgroup/release_common || die "Can't move cgroup.release_common.example"
+ ln -s release_common "${D}"/etc/slurm/cgroup/release_cpuset || die "Can't create symbolic link release_cpuset"
+ ln -s release_common "${D}"/etc/slurm/cgroup/release_devices || die "Can't create symbolic link release_devices"
+ ln -s release_common "${D}"/etc/slurm/cgroup/release_freezer || die "Can't create symbolic link release_freezer"
+}
+
+pkg_preinst() {
+ if use munge; then
+ sed -i 's,\(SLURM_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/slurm || die
+ fi
+ if use ypbind; then
+ sed -i 's,\(SLURM_USE_YPBIND=\).*,\11,' "${D}"etc/conf.d/slurm || die
+ fi
+}
+
+create_folders_and_fix_permissions() {
+ einfo "Fixing permissions in ${@}"
+ mkdir -p ${@}
+ chown -R ${PN}:${PN} ${@}
+}
+
+pkg_postinst() {
+ paths=(
+ /var/${PN}/checkpoint
+ /var/${PN}
+ /var/spool/${PN}/slurmd
+ /var/spool/${PN}
+ /var/run/${PN}
+ /var/log/${PN}
+ /var/tmp/${PN}/${PN}d
+ /var/tmp/${PN}
+ )
+ for folder_path in ${paths[@]}; do
+ create_folders_and_fix_permissions $folder_path
+ done
+ einfo
+
+ elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
+ elog "through a (javascript enabled) browser to create a configureation file."
+ elog "Copy that file to /etc/slurm/slurm.conf on all nodes (including the headnode) of your cluster."
+ einfo
+ elog "For cgroup support, please see http://www.schedmd.com/slurmdocs/cgroup.conf.html"
+ elog "Your kernel must be compiled with the wanted cgroup feature:"
+ elog " General setup --->"
+ elog " [*] Control Group support --->"
+ elog " [*] Freezer cgroup subsystem"
+ elog " [*] Device controller for cgroups"
+ elog " [*] Cpuset support"
+ elog " [*] Simple CPU accounting cgroup subsystem"
+ elog " [*] Resource counters"
+ elog " [*] Memory Resource Controller for Control Groups"
+ elog " [*] Group CPU scheduler --->"
+ elog " [*] Group scheduling for SCHED_OTHER"
+ elog "Then, set these options in /etc/slurm/slurm.conf:"
+ elog " ProctrackType=proctrack/cgroup"
+ elog " TaskPlugin=task/cgroup"
+ einfo
+ ewarn "Paths were created for slurm. Please use these paths in /etc/slurm/slurm.conf:"
+ for folder_path in ${paths[@]}; do
+ ewarn " ${folder_path}"
+ done
+}