summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bronder <jsbronder@gentoo.org>2008-07-10 03:28:56 +0000
committerJustin Bronder <jsbronder@gentoo.org>2008-07-10 03:28:56 +0000
commitaa77f5cd8d9794b5970061cb5236f916d6a088dd (patch)
treea37f58146cdde347257b3e9d83764ddfe64a46c9 /sys-cluster/torque
parentI guess virtualization isn't a herd yet (diff)
downloadgentoo-2-aa77f5cd8d9794b5970061cb5236f916d6a088dd.tar.gz
gentoo-2-aa77f5cd8d9794b5970061cb5236f916d6a088dd.tar.bz2
gentoo-2-aa77f5cd8d9794b5970061cb5236f916d6a088dd.zip
Bump torque to 2.3.1, add some fixes from svn for newer gcc's.
(Portage version: 2.1.4.4)
Diffstat (limited to 'sys-cluster/torque')
-rw-r--r--sys-cluster/torque/ChangeLog8
-rw-r--r--sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch372
-rw-r--r--sys-cluster/torque/torque-2.3.1.ebuild233
3 files changed, 612 insertions, 1 deletions
diff --git a/sys-cluster/torque/ChangeLog b/sys-cluster/torque/ChangeLog
index 593bb2c88bfe..449e11ecf213 100644
--- a/sys-cluster/torque/ChangeLog
+++ b/sys-cluster/torque/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-cluster/torque
# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.69 2008/06/18 13:04:11 fmccor Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/ChangeLog,v 1.70 2008/07/10 03:28:56 jsbronder Exp $
+
+*torque-2.3.1 (10 Jul 2008)
+
+ 10 Jul 2008; Justin Bronder <jsbronder@gentoo.org>
+ +files/torque-2.3-fixes-r2221-2227.patch, +torque-2.3.1.ebuild:
+ Bump torque to 2.3.1, add some fixes from svn for newer gcc's.
18 Jun 2008; Ferris McCormick <fmccor@gentoo.org> torque-2.3.0-r1.ebuild:
Sparc stable, required for bug #224099.
diff --git a/sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch b/sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch
new file mode 100644
index 000000000000..81af4a5e790c
--- /dev/null
+++ b/sys-cluster/torque/files/torque-2.3-fixes-r2221-2227.patch
@@ -0,0 +1,372 @@
+Index: src/include/qmgr.h
+===================================================================
+--- src/include/qmgr.h (revision 2221)
++++ src/include/qmgr.h (revision 2227)
+@@ -166,30 +166,30 @@
+
+
+ /* prototypes */
+-struct objname *commalist2objname();
+-struct server *find_server();
++struct objname *commalist2objname(char *, int);
++struct server *find_server(char *);
+ struct server *make_connection();
+ struct server *new_server();
+ struct objname *new_objname();
+-struct objname *strings2objname( );
++struct objname *strings2objname(char **, int, int);
+ struct objname *default_server_name();
+-struct objname *temp_objname();
+-int parse_request( );
+-void clean_up_and_exit();
+-void freeattrl();
+-void freeattropl();
+-void pstderr_big();
+-void free_objname_list();
+-void free_server();
+-void free_objname();
++struct objname *temp_objname(char *, char *, struct server *);
++int parse_request(char *, char [][MAX_REQ_WORD_LEN]);
++void clean_up_and_exit(int);
++void freeattrl(struct attrl *);
++void freeattropl(struct attropl *);
++void pstderr_big(char *, char*, char *);
++void free_objname_list(struct objname *);
++void free_server(struct server *);
++void free_objname(struct objname *);
+ void close_non_ref_servers();
+-int connect_servers();
+-int set_active();
+-int get_request();
+-int parse();
+-int execute();
+-int is_attr();
+-int is_valid_object();
++int connect_servers(struct objname *, int);
++int set_active(int, struct objname *);
++int get_request(char *);
++int parse(char *, int *, int *, char **, struct attropl **);
++int execute(int, int, int, char *, struct attropl *);
++int is_attr(int, char *, int);
++int is_valid_object(struct objname *, int);
+ void disconnect_from_server();
+
+
+Index: src/include/md5.h
+===================================================================
+--- src/include/md5.h (revision 2221)
++++ src/include/md5.h (revision 2227)
+@@ -55,9 +55,9 @@
+ unsigned char digest[16]; /* actual digest after MD5Final call */
+ } MD5_CTX;
+
+-void MD5Init ();
+-void MD5Update ();
+-void MD5Final ();
++void MD5Init (MD5_CTX *);
++void MD5Update (MD5_CTX *, unsigned char *, unsigned int);
++void MD5Final (MD5_CTX *);
+
+ #define __MD5_INCLUDE__
+ #endif /* __MD5_INCLUDE__ */
+Index: src/include/mom_func.h
+===================================================================
+--- src/include/mom_func.h (revision 2221)
++++ src/include/mom_func.h (revision 2227)
+@@ -149,7 +149,7 @@
+ extern int set_mach_vars A_((job *, struct var_table *));
+ extern char *set_shell A_((job *, struct passwd *));
+ extern void start_exec A_((job *));
+-extern int open_master();
++extern int open_master(char **);
+ extern int open_slave();
+ extern char *rcvttype A_((int));
+ extern int rcvwinsize A_((int));
+Index: src/include/pbs_config.h.in
+===================================================================
+--- src/include/pbs_config.h.in (revision 2221)
++++ src/include/pbs_config.h.in (revision 2227)
+@@ -316,6 +316,9 @@
+ /* use nodemask-based scheduling on O2k */
+ #undef NODEMASK
+
++/* Define to disable posix memlock */
++#undef NOPOSIXMEMLOCK
++
+ /* Define to disable privileged ports */
+ #undef NOPRIVPORTS
+
+Index: src/cmds/qstop.c
+===================================================================
+--- src/cmds/qstop.c (revision 2221)
++++ src/cmds/qstop.c (revision 2227)
+@@ -108,7 +108,7 @@
+
+
+ int exitstatus = 0; /* Exit Status */
+-static void execute ();
++static void execute (char *, char *);
+
+
+ int main ( argc, argv )
+Index: src/cmds/qenable.c
+===================================================================
+--- src/cmds/qenable.c (revision 2221)
++++ src/cmds/qenable.c (revision 2227)
+@@ -109,7 +109,7 @@
+
+
+ int exitstatus = 0; /* Exit Status */
+-static void execute ();
++static void execute (char *, char *);
+
+
+ int main(
+Index: src/cmds/qsub.c
+===================================================================
+--- src/cmds/qsub.c (revision 2221)
++++ src/cmds/qsub.c (revision 2227)
+@@ -3823,7 +3823,7 @@
+ {
+ strcat(submit_args_str,argv[argi]);
+
+- if (argi != optind - 1)
++ if (argi != argc - 1)
+ {
+ strcat(submit_args_str," ");
+ }
+Index: src/cmds/qstart.c
+===================================================================
+--- src/cmds/qstart.c (revision 2221)
++++ src/cmds/qstart.c (revision 2227)
+@@ -108,7 +108,7 @@
+
+
+ int exitstatus = 0; /* Exit Status */
+-static void execute ();
++static void execute (char *, char *);
+
+
+ int main (
+Index: src/cmds/qdisable.c
+===================================================================
+--- src/cmds/qdisable.c (revision 2221)
++++ src/cmds/qdisable.c (revision 2227)
+@@ -110,7 +110,7 @@
+
+ int exitstatus = 0; /* Exit Status */
+
+-static void execute ();
++static void execute (char *, char *);
+
+ int main ( argc, argv )
+ int argc;
+Index: src/cmds/qrun.c
+===================================================================
+--- src/cmds/qrun.c (revision 2221)
++++ src/cmds/qrun.c (revision 2227)
+@@ -101,7 +101,7 @@
+ #include <pbs_config.h> /* the master config generated by configure */
+
+ int exitstatus = 0; /* Exit Status */
+-static void execute();
++static void execute(char *, char *, char *, int);
+
+
+
+Index: src/cmds/qterm.c
+===================================================================
+--- src/cmds/qterm.c (revision 2221)
++++ src/cmds/qterm.c (revision 2227)
+@@ -113,7 +113,7 @@
+
+ int exitstatus = 0; /* Exit Status */
+
+-static void execute();
++static void execute(int, char *);
+
+ int main(
+
+Index: src/resmom/start_exec.c
+===================================================================
+--- src/resmom/start_exec.c (revision 2221)
++++ src/resmom/start_exec.c (revision 2227)
+@@ -133,6 +133,10 @@
+ #include "pbs_cpuset.h"
+ #endif
+
++#ifdef NOPOSIXMEMLOCK
++#undef _POSIX_MEMLOCK
++#endif /* NOPOSIXMEMLOCK */
++
+ #define EXTRA_VARIABLE_SPACE 2000
+ #define EXTRA_ENV_PTRS 32
+
+@@ -4678,9 +4682,9 @@
+
+ MD5Init(&c);
+
+- MD5Update(&c,(caddr_t)&loopcnt,sizeof(loopcnt));
++ MD5Update(&c,(unsigned char *)&loopcnt,sizeof(loopcnt));
+
+- MD5Update(&c,(caddr_t)pjob,sizeof(job));
++ MD5Update(&c,(unsigned char *)pjob,sizeof(job));
+
+ MD5Final(&c);
+
+@@ -5286,7 +5290,7 @@
+
+ /* don't do for checkpoint file names, only StdErr and StdOut */
+
+- if (suffix != JOB_CKPT_SUFFIX)
++ if (strcmp(suffix, JOB_CKPT_SUFFIX) != 0)
+ {
+ pt = strstr(jobpath,"$HOME");
+
+Index: src/resmom/mom_server.c
+===================================================================
+--- src/resmom/mom_server.c (revision 2221)
++++ src/resmom/mom_server.c (revision 2227)
+@@ -2533,7 +2533,7 @@
+ {
+ int sindex;
+
+- for (sindex = 0; sindex < PBS_MAXSERVER || down_svraddrs[sindex] == 0; sindex++)
++ for (sindex = 0; sindex < PBS_MAXSERVER && down_svraddrs[sindex] != 0; sindex++)
+ {
+ if (down_svraddrs[sindex] == server_address)
+ {
+Index: src/resmom/mom_main.c
+===================================================================
+--- src/resmom/mom_main.c (revision 2221)
++++ src/resmom/mom_main.c (revision 2227)
+@@ -146,6 +146,9 @@
+
+ #include "mcom.h"
+
++#ifdef NOPOSIXMEMLOCK
++#undef _POSIX_MEMLOCK
++#endif /* NOPOSIXMEMLOCK */
+
+ #ifdef _POSIX_MEMLOCK
+ #include <sys/mman.h>
+Index: src/server/req_stat.c
+===================================================================
+--- src/server/req_stat.c (revision 2221)
++++ src/server/req_stat.c (revision 2227)
+@@ -119,7 +119,7 @@
+ extern int pbs_mom_port;
+ extern time_t time_now;
+ extern char *msg_init_norerun;
+-extern struct pbsnode *tfind_addr();
++extern struct pbsnode *tfind_addr(const u_long);
+ extern int LOGLEVEL;
+
+ /* Extern Functions */
+Index: src/lib/Libnet/md5.c
+===================================================================
+--- src/lib/Libnet/md5.c (revision 2221)
++++ src/lib/Libnet/md5.c (revision 2227)
+@@ -49,7 +49,7 @@
+ */
+
+ /* forward declaration */
+-static void Transform ();
++static void Transform (UINT4 *, UINT4 *);
+
+ static unsigned char PADDING[64] = {
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+Index: src/lib/Libnet/net_server.c
+===================================================================
+--- src/lib/Libnet/net_server.c (revision 2221)
++++ src/lib/Libnet/net_server.c (revision 2227)
+@@ -115,7 +115,7 @@
+
+ extern void process_request A_((int));
+
+-extern time_t time();
++extern time_t time(time_t *);
+
+ /* Global Data (I wish I could make it private to the library, sigh, but
+ * C don't support that scope of control.)
+Index: configure.ac
+===================================================================
+--- configure.ac (revision 2221)
++++ configure.ac (revision 2227)
+@@ -79,7 +79,7 @@
+ dnl
+ AC_MSG_CHECKING([whether to turn on the AUTORUN_JOBS flag])
+ AC_ARG_ENABLE(autorun,
+- [ --enable-autorun turn on the AUTORUN_JOBS flag],
++ [ --enable-autorun turn on the AUTORUN_JOBS flag],
+ enable_autorun=$enableval, enable_autorun=no)
+ AC_MSG_RESULT($enable_autorun)
+ if test "x$enable_autorun" = "xyes" ; then
+@@ -94,7 +94,7 @@
+ dnl
+ AC_MSG_CHECKING([whether to turn on the RESOURCEMAXNOTDEFAULT flag])
+ AC_ARG_ENABLE(maxnotdefault,
+- [ --enable-maxnotdefault turn on the RESOURCEMAXNOTDEFAULT flag],
++ [ --enable-maxnotdefault turn on the RESOURCEMAXNOTDEFAULT flag],
+ enable_maxnotdefault=$enableval, enable_maxnotdefault=no)
+ AC_MSG_RESULT($enable_maxnotdefault)
+ if test "x$enable_maxnotdefault" = "xyes" ; then
+@@ -108,7 +108,7 @@
+ dnl
+ AC_MSG_CHECKING([whether to turn on the QUICKCOMMIT flag])
+ AC_ARG_ENABLE(quickcommit,
+- [ --enable-quickcommit turn on the QUICKCOMMIT flag],
++ [ --enable-quickcommit turn on the QUICKCOMMIT flag],
+ enable_quickcommit=$enableval, enable_quickcommit=no)
+ AC_MSG_RESULT($enable_quickcommit)
+ if test "x$enable_quickcommit" = "xyes" ; then
+@@ -122,7 +122,7 @@
+ dnl
+ AC_MSG_CHECKING([whether to turn on the NO_SIGCHLD flag])
+ AC_ARG_ENABLE(nochildsignal,
+- [ --enable-nochildsignal turn on the NO_SIGCHLD flag],
++ [ --enable-nochildsignal turn on the NO_SIGCHLD flag],
+ enable_nochildsignal=$enableval, enable_nochildsignal=no)
+ AC_MSG_RESULT($enable_nochildsignal)
+ if test "x$enable_nochildsignal" = "xyes" ; then
+@@ -709,6 +709,18 @@
+ AC_DEFINE_UNQUOTED(SHELL_USE_ARGV, ${SHELL_USE_ARGV}, [job script name passed as the shell's arg])
+
+
++
++AC_ARG_ENABLE(posixmemlock, [
++ --disable-posixmemlock disable the moms use of mlockall.
++ Some versions of OSs seem to have buggy POSIX MEMLOCK.],
++[case "${enableval}" in
++ yes) ;;
++ no) NOPOSIXMEMLOCK=1; AC_DEFINE(NOPOSIXMEMLOCK, 1, [Define to disable mlockall]) ;;
++ *) AC_MSG_ERROR(--enable-posixmemlock cannot take a value) ;;
++esac])dnl
++
++
++
+ AC_ARG_ENABLE(privports, [
+ --disable-privports disable the use of privileged ports for authentication.
+ Some versions of OSX have a buggy bind() and cannot
+@@ -726,7 +738,7 @@
+ [case "${enableval}" in
+ yes) MOMCHECKLOCALSPOOL=1 ;;
+ no) MOMCHECKLOCALSPOOL=0;;
+- *) AC_MSG_ERROR(--enable-privports cannot take a value) ;;
++ *) AC_MSG_ERROR(--enable-mom-checkspool cannot take a value) ;;
+ esac],[MOMCHECKLOCALSPOOL=1])dnl
+ AC_DEFINE_UNQUOTED(MOMCHECKLOCALSPOOL, ${MOMCHECKLOCALSPOOL}, [Define to error if spool is full on MOM])
+
+Index: doc/soelim.c
+===================================================================
+--- doc/soelim.c (revision 2221)
++++ doc/soelim.c (revision 2227)
+@@ -102,7 +102,7 @@
+ int argc;
+ char *argv[];
+ {
+- int dofile();
++ int dofile(FILE *);
+ int dirct = 0;
+ FILE *filein;
+ int i;
diff --git a/sys-cluster/torque/torque-2.3.1.ebuild b/sys-cluster/torque/torque-2.3.1.ebuild
new file mode 100644
index 000000000000..2a1a7c6bf5a7
--- /dev/null
+++ b/sys-cluster/torque/torque-2.3.1.ebuild
@@ -0,0 +1,233 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/torque/torque-2.3.1.ebuild,v 1.1 2008/07/10 03:28:56 jsbronder Exp $
+
+inherit autotools flag-o-matic eutils linux-info
+
+DESCRIPTION="Resource manager and queuing system based on OpenPBS"
+HOMEPAGE="http://www.clusterresources.com/products/torque/"
+SRC_URI="http://www.clusterresources.com/downloads/${PN}/${P}.tar.gz"
+
+LICENSE="openpbs"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="tk crypt server syslog doc cpusets kernel_linux"
+PROVIDE="virtual/pbs"
+
+# ed is used by makedepend-sh
+DEPEND_COMMON="virtual/libc
+ sys-libs/ncurses
+ sys-libs/readline
+ tk? ( dev-lang/tk )
+ syslog? ( virtual/logger )
+ !virtual/pbs
+ !sys-cluster/openpbs-common
+ !games-util/qstat"
+
+DEPEND="${DEPEND_COMMON}
+ sys-apps/ed"
+
+RDEPEND="${DEPEND_COMMON}
+ crypt? ( net-misc/openssh )
+ !crypt? ( net-misc/netkit-rsh )"
+
+[ -n "${PBS_SERVER_HOME}" ] || PBS_SERVER_HOME="/var/spool/torque"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ USE_CPUSETS="--disable-cpusets"
+ 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
+ einfo
+ elog " Torque support for cpusets is still in development, you may"
+ elog "wish to disable it for production use."
+ einfo
+ if ! 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-cpusets"
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Fixes gcc-4.2 compile errors. Changes to configure and CHANGELOG had to
+ # be removed to get the patch to apply cleanly.
+ # TODO: Will not be required in 2.3.2
+ epatch "${FILESDIR}"/torque-2.3-fixes-r2221-2227.patch
+}
+
+src_compile() {
+ local myconf="--with-rcp=mom_rcp"
+
+ use crypt && myconf="--with-rcp=scp"
+
+ [ -n "${PBS_SERVER_NAME}" ] || PBS_SERVER_NAME=$(hostname -f)
+
+ econf \
+ $(use_enable tk gui) \
+ $(use_enable syslog) \
+ $(use_enable server) \
+ --with-server-home=${PBS_SERVER_HOME} \
+ --with-environ=/etc/pbs_environment \
+ --with-default-server=${PBS_SERVER_NAME} \
+ --disable-gcc-warnings \
+ ${USE_CPUSETS} \
+ ${myconf} \
+ || die "econf failed"
+ emake || die "emake failed"
+}
+
+# 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}"
+ else
+ chmod ${m} "${root}${d}"
+ 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}"
+
+ make DESTDIR="${D}" install || die "make install failed"
+
+ dodoc CHANGELOG DEVELOPMENT README.* Release_Notes || die "dodoc failed"
+ if use doc; then
+ dodoc doc/admin_guide.ps doc/*.pdf || die "dodoc failed"
+ fi
+
+ # 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}"
+ done
+
+ if use server; then
+ newinitd "${FILESDIR}"/pbs_server-init.d-2.2.1-r1 pbs_server
+ newinitd "${FILESDIR}"/pbs_sched-init.d-2.2.1-r1 pbs_sched
+ fi
+ newinitd "${FILESDIR}"/pbs_mom-init.d-2.2.1-r1 pbs_mom
+ newconfd "${FILESDIR}"/torque-conf.d-2.2.1-r1 torque
+ newenvd "${FILESDIR}"/torque-env.d-2.2.1-r1 25torque
+}
+
+pkg_preinst() {
+ if [[ -f "${ROOT}etc/pbs_environment" ]]; then
+ cp "${ROOT}etc/pbs_environment" "${D}"/etc/pbs_environment
+ fi
+
+ if [ -n "${PBS_SERVER_NAME}" ]; then
+ echo "${PBS_SERVER_NAME}" > "${D}${PBS_SERVER_HOME}/server_name"
+ elif [[ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]]; then
+ cp "${ROOT}${PBS_SERVER_HOME}/server_name" "${D}${PBS_SERVER_HOME}/server_name"
+ fi
+
+ # 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
+}
+
+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"
+
+ elog " For a basic setup, you may use emerge --config ${PN}"
+}
+
+# Either the correct PBS_SERVER_HOME and PBS_SERVER_NAME are set
+# or we use the default HOME and the localhost as the server.
+# 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="${ROOT}/${PBS_SERVER_HOME}"
+ local rc=0
+
+ ebegin "Configuring Torque"
+ [ -n "${PBS_SERVER_NAME}" ] || PBS_SERVER_NAME=$(hostname -f)
+ einfo "Using ${PBS_SERVER_HOME} 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 any key to"
+ ewarn "continue or press Control-C to abort now"
+ read
+ fi
+
+ # pbs_mom configuration.
+ echo "\$pbsserver ${PBS_SERVER_NAME}" > "${h}/mom_priv/config"
+ echo "\$logevent 255" >> "${h}/mom_priv/config"
+
+ if use server; then
+ local qmgr="${ROOT}/usr/bin/qmgr -c"
+ if ! echo "y" | "${ROOT}"/usr/sbin/pbs_server \
+ -d "${ROOT}${PBS_SERVER_HOME}" -t create &>/dev/null; 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}
+
+ "${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"
+ fi
+ fi
+ eend ${rc}
+}