diff options
author | Justin Bronder <jsbronder@gentoo.org> | 2014-06-19 19:55:07 +0000 |
---|---|---|
committer | Justin Bronder <jsbronder@gentoo.org> | 2014-06-19 19:55:07 +0000 |
commit | 81e4acca1d745d947be445bdb33a69fd9903d599 (patch) | |
tree | 7bb4cb4264ef1858d5ed0361f035a9e4eeb72c93 /sys-cluster | |
parent | Add va_list patch by Steev Klimaszewski (bug #513860). (diff) | |
download | historical-81e4acca1d745d947be445bdb33a69fd9903d599.tar.gz historical-81e4acca1d745d947be445bdb33a69fd9903d599.tar.bz2 historical-81e4acca1d745d947be445bdb33a69fd9903d599.zip |
Bump 2.5.13 with additional patches for CVE-2013-4495 (#491270) and CVE-2014-0749 (#510726)
Package-Manager: portage-2.2.8-r1/cvs/Linux x86_64
Manifest-Sign-Key: 0x4D7043C9
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/torque/ChangeLog | 9 | ||||
-rw-r--r-- | sys-cluster/torque/Manifest | 14 | ||||
-rw-r--r-- | sys-cluster/torque/files/CVE-2013-4495.patch | 32 | ||||
-rw-r--r-- | sys-cluster/torque/files/CVE-2014-0749.patch | 32 | ||||
-rw-r--r-- | sys-cluster/torque/torque-2.5.13.ebuild | 252 |
5 files changed, 333 insertions, 6 deletions
diff --git a/sys-cluster/torque/ChangeLog b/sys-cluster/torque/ChangeLog index 0f152dc4d0d5..6ab81f3c494f 100644 --- a/sys-cluster/torque/ChangeLog +++ b/sys-cluster/torque/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-cluster/torque # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.166 2014/01/19 20:36:30 jsbronder Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.167 2014/06/19 19:55:00 jsbronder Exp $ + +*torque-2.5.13 (19 Jun 2014) + + 19 Jun 2014; Justin Bronder <jsbronder@gentoo.org> +torque-2.5.13.ebuild, + +files/CVE-2013-4495.patch, +files/CVE-2014-0749.patch: + Bump 2.5.13 with additional patches for CVE-2013-4495 (#491270) and + CVE-2014-0749 (#510726) 19 Jan 2014; Justin Bronder <jsbronder@gentoo.org> -torque-2.4.16.ebuild, -torque-2.4.16-r1.ebuild, -files/0001-fix-parallel-doc-install.patch, diff --git a/sys-cluster/torque/Manifest b/sys-cluster/torque/Manifest index 5c55184c61db..35f795edcd06 100644 --- a/sys-cluster/torque/Manifest +++ b/sys-cluster/torque/Manifest @@ -3,6 +3,8 @@ Hash: SHA256 AUX CVE-2013-4319-2.x-root-submit-fix.patch 1253 SHA256 a6ebd0c0966148ecb34fb885911e163f93749be72fc5a2e58f11f3c7a9523f45 SHA512 78780ad87e997f22b6abbc3cb51c313616e90320d997705c534c35fbc7f5738b7a2e0ace33051e6e15d4f6e0ab6f97ab9f1ef60dcee5fc4544db13b0a72ea5c4 WHIRLPOOL 64eaf701099da902282b3e1debb6bbfa323fc266ad067047c43dcb353463bf2df7475066f9e263cc9a506b2905aba19c290d50a419ee56a0daa65f237693ede7 AUX CVE-2013-4319-4.x-root-submit-fix.patch 1412 SHA256 ef88bbbfbda9f7c0d8a98fbd4a0b02e9c662678ba02eac12fbc50521d4d01581 SHA512 89f0b5fedfef5b0db1cdb3d190c7c2fa9c07d175e9b3020ec685e9553d710882ece1155249edeea25902c134ce52bf171fd1e7b2256716351e0e80d3fca5618c WHIRLPOOL 7ee954e3bae8336489bc4e2aed43256d2ecff29e332076255013c78415b4cc5b159b15ab1bc5575493df676393ecd0fd89a1dff4493374f689d3258ad2b7ae57 +AUX CVE-2013-4495.patch 836 SHA256 4cfaef5ced3b336920821089a97a86f38d71fcc573951912be701d2c51253d45 SHA512 91522f5c8b6fa2e5de80f02e24b2a6827422c335d88600bcbb1a763dd985b3e52b850eab5059adbe4e543311551ec0da21cd69fcb7dc6e01ff93bff843769d8c WHIRLPOOL 17e2790d362a16dcd58b0cb0a9acc81d5f920b96ad8d4eb99fff6cbd58a49e312414c9c9b580b9fbdbd35b4314fb0ea820888e4d93723ffec5ec02cc3c72bbf2 +AUX CVE-2014-0749.patch 750 SHA256 e79c9c2e08aec2e0adc4a10c2d97510ccc6780d5d2944e9fd646bf99b0a5e5aa SHA512 8830f4d1a0190876e97fc568a3ac84341c042686a630cc5a7d8f254414dd13063f08db3b490e447698d9c16430ab6c8990c70ee1acda2435a0b0debfb2666829 WHIRLPOOL 76a459649865456b1d004de5d728c97697f4351870f54980748dfc2046df26ed791738cea96189d3f82b76f8aa370904060ecdbcc0b52c5e092d2870221a132c AUX pbs_mom-init.d 1083 SHA256 8be6003cc86cc9deff259414615b5cb4099f10c13930f91dd1ecee5572b98ae2 SHA512 8770087494eb3dacd4c19f5835ef9534e9924dcb8d6e4d97ac3b70dcec7c8c2585aaa4491a4166d31f6a7b74fa47db4115cb721ea6356f0863929b5a3e865bf4 WHIRLPOOL 44607077202cb520f1b4af1114d17816385c0008fcf9d38d416ac867ee5e1145957d0292e1f970a71f7c6b4dd1a3d3e575da743b42970652dee5e204f79127d7 AUX pbs_mom-init.d-munge 1148 SHA256 c8c5dc40960512f8a0410f50114d3d71f92c17811342acd6a01cbf0475b16cbe SHA512 ace375eed3dde368683e184f0f190023bafffdcdac39bebec39866f18be9552e2b02ea0b688ac8f75c676b3d30e61e7e0e03b961a8e17b71ca646afd2d57347b WHIRLPOOL effbe164dfbdfab4cd44ccae74a727a8dc3bfa335c8e991f84a9c1b4ee5ae5ee142b000dc724f4ff8b1e1dca0f6f8db2a32d23090727ad4f85d105bbf2c52b9f AUX pbs_sched-init.d 1164 SHA256 07924a441544c0b72283e546fa5b17bb422cfeb9421fcafafedaa997268696dc SHA512 2bf9371bde2cd43c452b765498e8f5bd791c4ba93c8142a89a594ae14447c95eaeec0e87bca8877817c2e2d162cb70f8a64d9add32c175f9fb156b65964b9aeb WHIRLPOOL 16e13e0d618fef0a2d69f4b009ff2cccdc918256fe3436a3d86b83ed9dad26a9a01c6ccd9eaf285647243de8b79179d8470afdbc7b492159bfae3b608fc2db0a @@ -15,15 +17,17 @@ AUX torque-conf.d-munge 784 SHA256 7b8e47737211fd0d05dcc7938021ea5dbb1575010c530 AUX torque-env.d 240 SHA256 d04eab3b1314645ee2014c718c4cf79ca74950dee1357d814b85c9faa5ef6002 SHA512 275ce5ccf9f138bcee504a9996c9d838cd34714d352d4b7ac2d631d0fca662bf38a2ef7e8745605d9b3847049015e0791c937340cfdacbf44800482ce73bb042 WHIRLPOOL b7cdc4d6752d00b315fb369f6382e1a6684c1cb8a3486545bd406270ed09811936c2735755fc01175fceed0422139e5d7d8dcd67868e2e40c8ebbb406c2eec57 AUX trqauthd-init.d 594 SHA256 3f3d603e78a21acf88e96c7affc9bbf56ca8568ce17165d3a0e936693724f73e SHA512 6af5f698438ac7f4cee62928685187d41a64366c528fbb03f6340bdee53fd361d596c5e2e47ecb1fbc797a1139e58a20bfe8d759fd1b6d2ecac3730249309b16 WHIRLPOOL d78de5decdf9958231469ef04f5ce266ab35c76a9f28f2ccb98b0f13eafcfd02db1bd173b275606005b3aa02f72dd972dbadc8a66c0ef19fa930e1400c354a5a DIST torque-2.5.12.tar.gz 5862988 SHA256 436b4d84464e3be0538a4dc0a657b5ae113da6b429d449261e95e13a2a96316b SHA512 12615e412bf90b4248f76e28627ece21116969e4f009629598482ec4432a5e8b6b10ce695e3abc1e3ac43fa2325b5e04b176316ef3c21e4795cb610101f9afae WHIRLPOOL 57b636b34fd72967304babe11340852c0d06519d60705ac088483831b688517104a7ef064dd7b0375cfc35f093858754f65a9f4fd026a65ead85d0544323d682 +DIST torque-2.5.13.tar.gz 5854910 SHA256 ab59d4c8e8b45383ddd8202fa83956816175e348bb955a4ad5f7e3cd4dde5ff9 SHA512 e08ddf3950bb32177f4bc504a502fae3928a616739c28ca9687c5207606817d4589583306508a2c568cf19fc8c5617dc4a9decc81576c2875660b715c256cfcf WHIRLPOOL 29eefb89d1eb9d6a81735aa117922a1eb0b72e14eeccab7dbd70cdcf01431b7ecd9c3927e1c5c28b7f42d6739b28f45386740b92adb790ccdf9803e4c6e38534 DIST torque-4.1.5.1.tar.gz 6214726 SHA256 10fa10625256d26e9371abbc98ca8ecf307ccc2ef117e32a0bf806de105037dd SHA512 630b4a9c7d9d6b14bc807dfba868e78894856d24e7b10703c76b519edf78876e33ef158edd6dd8abeb3ffb6bfe8036e74eff23501d476ef9ebe817b46d2e3c5c WHIRLPOOL 6709a3eec73f39c27d4dd02ab62d74448a93a442bdf585d5f244142de8f54b42fdd841c773226589de4c3e0a9c881bdd51d4c04bf57235136086cab18dd6fa42 EBUILD torque-2.5.12-r1.ebuild 7637 SHA256 06709db3e6a4de2c545467584813f05385b76e64350f77e9c70b3559aae068fb SHA512 ec992ccb9430bf74e85025b3d23154f2a91c2281e9b424818002d75873152940424543c7b06e70b3c2d3d58a15b4e241022b42128a189fe587833918eed0eac7 WHIRLPOOL ee89d2da1fdbd11bcc8e3012b0c4acdc895271e483e9d70ca2e7d7db65e3532f2d251b70884757861842c0708cdfdf8ceef2cd15d61f786a361ca1dc7084e8d9 +EBUILD torque-2.5.13.ebuild 7749 SHA256 d6341222bcd51c48f59f0d1703cefae99e81665251da24ee2bc29391f82a05fa SHA512 9fc230bd7b698faa26eca29efbfe1f05843d4385e034de5194a638c22ddc3d8e35f36406685ade448094f8b1f9b89bac2f961aafa1739f5cce850f0693fd2185 WHIRLPOOL 14e1bd68466c463be5063f3db371a14588ad84db0fe6629f7fecf244ae2669d63c683da6f665e7e54ce369b152cd53ba80d1f1f26f5f96a5bc73261e2526e39f EBUILD torque-4.1.5.1-r1.ebuild 7128 SHA256 81805f6dcf0d469c9e496f223a7690757c55bd9d7225b7eac2233566383d9cb8 SHA512 03e920f78833f41d5a2b83484df73ff8bd29ec83e85f63dbbd07922d5609e921e47a7d91da6689caad72afd537dc16dab7b7b6db4a9c7ef1c747905e7424cb92 WHIRLPOOL 8bb64bf0223ec2e710d04159e6943e400bc44158f76b0b90688ac1d9a13a89c2da44caaeb8ba4f0da50653d86bb6922f31d0cc7ed54344c4f7f5ba01d9feddc4 -MISC ChangeLog 28278 SHA256 c74cd0c2a4e5f4f229692af2d7bc80df29239d883d09c908190680d9e30c1d0b SHA512 3de2e1c109d6368b32b2aef98f7a4e64e9d9d80ffc82d25548f4eb6ec81ab7ed4b39d5a524301a0e7868f84bbfeec324e587889f85c091a1b82ab57935dff20b WHIRLPOOL 17bf65b9036169d74534f2dc04a1162b09e39d7c4014d0c3cdbea791ab2b6d8fdf71d772fa1bf83be2df7e0495c5ce1fa0cc385f4dc5c0c8a75c4e53b84eb19e +MISC ChangeLog 28539 SHA256 2cb96d4d5d19955fa69ed120176e7ba936e7f3889620bc14eaf5a73322826be4 SHA512 27f92423fd2cc7c3192bdfd1a88c5f2a8ea0ae3c5b949d6734fc20a390e4ab07161d419fa3eb487e2c23c80f0cbcfcc39fb31432e13a81881ebd6d64cd9c95e0 WHIRLPOOL d2595816bd56569494c60c3c29fd8b991287f97aaf35a3df9538501f42f6df9e5c6e0a2b67851a39035b212fdd62a885e995f1da40d31c4e29146a0a3a79780d MISC metadata.xml 628 SHA256 10fab1886476e44fabbcda6e7dbbc8452d07cb0de0cefcf6e594312dfe89f7af SHA512 d1c78c4247f209eda60a61c9c611c4a4b87d52f85b112a78b96a4dee6f3cd660aef49547323074d69ffce8c1b916c3914f00282781e2f68f76658e6f9ac7ff9b WHIRLPOOL 243373e602f92a256118e6bee6c3071d5894caf3d53a663abee6929a310cf306b15a6a7bd2a0e76882cfe36cd4e8b6c06bb9e12f49f678d085883d61d4a84cf9 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.22 (GNU/Linux) +Version: GnuPG v2.0.20 (GNU/Linux) -iEYEAREIAAYFAlLcN1IACgkQ4MrvBE1wQ8moRQCdGERYbcGJ5oKaTvQ5yZa+itM5 -RpQAnRvye0DG7itanDaTFXkFjaYp1DA9 -=jbGk +iEYEAREIAAYFAlOjQBoACgkQ4MrvBE1wQ8mSRgCghNqxN/PFsJF5EqNQ+Rw8fPud +894AnRxb/clOic/kI7f0YBGwuJx+wk2w +=F+3w -----END PGP SIGNATURE----- diff --git a/sys-cluster/torque/files/CVE-2013-4495.patch b/sys-cluster/torque/files/CVE-2013-4495.patch new file mode 100644 index 000000000000..41232c07ec72 --- /dev/null +++ b/sys-cluster/torque/files/CVE-2013-4495.patch @@ -0,0 +1,32 @@ +From 8246d967bbcf174482ef01b1bf4920a5944b1011 Mon Sep 17 00:00:00 2001 +From: David Beer <dbeer@adaptivecomputing.com> +Date: Wed, 13 Nov 2013 10:47:48 -0700 +Subject: [PATCH] Use Michael Jenning's patch for CVE 2013-4495 instead of the + original. This one is being used because 2.5 should face the minimal possible + change. + +--- + src/server/svr_mail.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/server/svr_mail.c b/src/server/svr_mail.c +index 26b6dd7..241bdfc 100644 +--- a/src/server/svr_mail.c ++++ b/src/server/svr_mail.c +@@ -372,11 +372,9 @@ void svr_mailowner( + exit(1); + } + +- sprintf(cmdbuf, "%s -f %s %s", +- ++ sprintf(cmdbuf, "%s -t -f %s", + SENDMAIL_CMD, +- mailfrom, +- mailto); ++ mailfrom); + + outmail = (FILE *)popen(cmdbuf, "w"); + +-- +1.8.3.2 + diff --git a/sys-cluster/torque/files/CVE-2014-0749.patch b/sys-cluster/torque/files/CVE-2014-0749.patch new file mode 100644 index 000000000000..52131edcf7e0 --- /dev/null +++ b/sys-cluster/torque/files/CVE-2014-0749.patch @@ -0,0 +1,32 @@ +From 3ed749263abe3d69fa3626d142a5789dcb5a5684 Mon Sep 17 00:00:00 2001 +From: David Beer <dbeer@adaptivecomputing.com> +Date: Fri, 23 Aug 2013 15:53:09 -0600 +Subject: [PATCH] Merge pull request #171 into 2.5-fixes. + +--- + src/lib/Libdis/disrsi_.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/lib/Libdis/disrsi_.c b/src/lib/Libdis/disrsi_.c +index 69edd28..154514c 100644 +--- a/src/lib/Libdis/disrsi_.c ++++ b/src/lib/Libdis/disrsi_.c +@@ -112,6 +112,15 @@ int disrsi_( + if (dis_umaxd == 0) + disiui_(); + ++ if (count >= dis_umaxd) ++ { ++ if (count > dis_umaxd) ++ goto overflow; ++ ++ if (memcmp(scratch, dis_umax, dis_umaxd) > 0) ++ goto overflow; ++ } ++ + switch (c = (*dis_getc)(stream)) + { + +-- +1.8.3.2 + diff --git a/sys-cluster/torque/torque-2.5.13.ebuild b/sys-cluster/torque/torque-2.5.13.ebuild new file mode 100644 index 000000000000..dbcff5007bf0 --- /dev/null +++ b/sys-cluster/torque/torque-2.5.13.ebuild @@ -0,0 +1,252 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.5.13.ebuild,v 1.1 2014/06/19 19:55:00 jsbronder Exp $ + +EAPI=4 + +inherit autotools-utils eutils flag-o-matic linux-info + +DESCRIPTION="Resource manager and queuing system based on OpenPBS" +HOMEPAGE="http://www.adaptivecomputing.com/products/open-source/torque" +SRC_URI="http://www.adaptivecomputing.com/index.php?wpfb_dl=1643 -> ${P}.tar.gz" + +LICENSE="torque-2.5" + +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="cpusets +crypt doc drmaa kernel_linux munge server static-libs +syslog threads tk xml" + +# ed is used by makedepend-sh +DEPEND_COMMON="sys-libs/ncurses + sys-libs/readline + munge? ( sys-auth/munge ) + tk? ( dev-lang/tk ) + syslog? ( virtual/logger ) + !games-util/qstat" + +DEPEND="${DEPEND_COMMON} + sys-apps/ed + !sys-cluster/slurm" + +RDEPEND="${DEPEND_COMMON} + crypt? ( net-misc/openssh ) + !crypt? ( net-misc/netkit-rsh )" + +DOCS=( Release_Notes ) + +AUTOTOOLS_IN_SOURCE_BUILD=1 + +pkg_setup() { + PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/torque}" + + # Find a Torque server to use. Check environment, then + # current setup (if any), and fall back on current hostname. + if [ -z "${PBS_SERVER_NAME}" ]; then + if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then + PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)" + else + PBS_SERVER_NAME=$(hostname -f) + fi + fi + + USE_CPUSETS="--disable-cpuset" + if use cpusets; then + if ! use kernel_linux; then + einfo + elog " Torque currently only has support for cpusets in linux." + elog "Assuming you didn't really want this USE flag." + einfo + else + linux-info_pkg_setup + einfo + elog " Torque support for cpusets is still in development, you may" + elog "wish to disable it for production use." + einfo + if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then + einfo + elog " Torque support for cpusets will require that you recompile" + elog "your kernel with CONFIG_CPUSETS enabled." + einfo + fi + USE_CPUSETS="--enable-cpuset" + fi + fi +} + +src_prepare() { + epatch "${FILESDIR}"/CVE-2013-4319-2.x-root-submit-fix.patch + epatch "${FILESDIR}"/tcl8.6.patch + + # 510726 + epatch "${FILESDIR}"/CVE-2014-0749.patch + + # 491270 + epatch "${FILESDIR}"/CVE-2013-4495.patch + + # Unused and causes breakage when switching from glibc to tirpc. + # https://github.com/adaptivecomputing/torque/pull/148 + sed -i '/rpc\/rpc\.h/d' src/lib/Libnet/net_client.c || die +} + +src_configure() { + local myeconfargs=( --with-rcp=mom_rcp ) + + use crypt && myeconfargs=( --with-rcp=scp ) + + myeconfargs+=( + $(use_enable tk gui) + $(use_enable tk tcl-qstat) + $(use_enable syslog) + $(use_enable server) + $(use_enable drmaa) + $(use_enable threads high-availability) + $(use_enable xml server-xml) + $(use_enable munge munge-auth) + --with-server-home=${PBS_SERVER_HOME} + --with-environ=/etc/pbs_environment + --with-default-server=${PBS_SERVER_NAME} + --disable-gcc-warnings + --with-tcp-retry-limit=2 + ${USE_CPUSETS} + ) + autotools-utils_src_configure +} + +# WARNING +# OpenPBS is extremely stubborn about directory permissions. Sometimes it will +# just fall over with the error message, but in some spots it will just ignore +# you and fail strangely. Likewise it also barfs on our .keep files! +pbs_createspool() { + local root="$1" + local s="$(dirname "${PBS_SERVER_HOME}")" + local h="${PBS_SERVER_HOME}" + local sp="${h}/server_priv" + einfo "Building spool directory under ${D}${h}" + local a d m + local dir_spec=" + 0755:${h}/aux 0700:${h}/checkpoint + 0755:${h}/mom_logs 0751:${h}/mom_priv 0751:${h}/mom_priv/jobs + 1777:${h}/spool 1777:${h}/undelivered" + + if use server; then + dir_spec="${dir_spec} 0755:${h}/sched_logs + 0755:${h}/sched_priv/accounting 0755:${h}/server_logs + 0750:${h}/server_priv 0755:${h}/server_priv/accounting + 0750:${h}/server_priv/acl_groups 0750:${h}/server_priv/acl_hosts + 0750:${h}/server_priv/acl_svr 0750:${h}/server_priv/acl_users + 0750:${h}/server_priv/jobs 0750:${h}/server_priv/queues" + fi + + for a in ${dir_spec}; do + d="${a/*:}" + m="${a/:*}" + if [[ ! -d "${root}${d}" ]]; then + install -d -m${m} "${root}${d}" || die + else + chmod ${m} "${root}${d}" || die + fi + # (#149226) If we're running in src_*, then keepdir + if [[ "${root}" = "${D}" ]]; then + keepdir ${d} + fi + done +} + +src_install() { + # Make directories first + pbs_createspool "${D}" + + autotools-utils_src_install + + use doc && dodoc doc/admin_guide.ps doc/*.pdf + + # The build script isn't alternative install location friendly, + # So we have to fix some hard-coded paths in tclIndex for xpbs* to work + for file in `find "${D}" -iname tclIndex`; do + sed -e "s/${D//\// }/ /" "${file}" > "${file}.new" + mv "${file}.new" "${file}" || die + done + + if use server; then + newinitd "${FILESDIR}"/pbs_server-init.d-munge pbs_server + newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched + fi + newinitd "${FILESDIR}"/pbs_mom-init.d-munge pbs_mom + newconfd "${FILESDIR}"/torque-conf.d-munge torque + newenvd "${FILESDIR}"/torque-env.d 25torque +} + +pkg_preinst() { + if [[ -f "${ROOT}etc/pbs_environment" ]]; then + cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment || die + fi + + echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name" || die + + # Fix up the env.d file to use our set server home. + sed -i \ + "s:/var/spool/torque:${PBS_SERVER_HOME}:g" "${D}"/etc/env.d/25torque \ + || die + + if use munge; then + sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${D}"etc/conf.d/torque || die + fi +} + +pkg_postinst() { + pbs_createspool "${ROOT}" + elog " If this is the first time torque has been installed, then you are not" + elog "ready to start the server. Please refer to the documentation located at:" + elog "http://www.clusterresources.com/wiki/doku.php?id=torque:torque_wiki" + echo + elog " For a basic setup, you may use emerge --config ${PN}" +} + +# root will be setup as the primary operator/manager, the local machine +# will be added as a node and we'll create a simple queue, batch. +pkg_config() { + local h="$(echo "${ROOT}/${PBS_SERVER_HOME}" | sed 's:///*:/:g')" + local rc=0 + + ebegin "Configuring Torque" + einfo "Using ${h} as the pbs homedir" + einfo "Using ${PBS_SERVER_NAME} as the pbs_server" + + # Check for previous configuration and bail if found. + if [ -e "${h}/server_priv/acl_svr/operators" ] \ + || [ -e "${h}/server_priv/nodes" ] \ + || [ -e "${h}/mom_priv/config" ]; then + ewarn "Previous Torque configuration detected. Press Enter to" + ewarn "continue or Control-C to abort now" + read + fi + + # pbs_mom configuration. + echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config" || die + echo "\$logevent 255" >> "${h}/mom_priv/config" || die + + if use server; then + local qmgr="${ROOT}/usr/bin/qmgr -c" + # pbs_server bails on repeated backslashes. + if ! "${ROOT}"/usr/sbin/pbs_server -f -d "${h}" -t create; then + eerror "Failed to start pbs_server" + rc=1 + else + ${qmgr} "set server operators = root@$(hostname -f)" ${PBS_SERVER_NAME} \ + && ${qmgr} "create queue batch" ${PBS_SERVER_NAME} \ + && ${qmgr} "set queue batch queue_type = Execution" ${PBS_SERVER_NAME} \ + && ${qmgr} "set queue batch started = True" ${PBS_SERVER_NAME} \ + && ${qmgr} "set queue batch enabled = True" ${PBS_SERVER_NAME} \ + && ${qmgr} "set server default_queue = batch" ${PBS_SERVER_NAME} \ + && ${qmgr} "set server resources_default.nodes = 1" ${PBS_SERVER_NAME} \ + && ${qmgr} "set server scheduling = True" ${PBS_SERVER_NAME} \ + || die + + "${ROOT}"/usr/bin/qterm -t quick ${PBS_SERVER_NAME} || rc=1 + + # Add the local machine as a node. + echo "$(hostname -f) np=1" > "${h}/server_priv/nodes" || die + fi + fi + eend ${rc} +} |