diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2005-07-05 20:02:19 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2005-07-05 20:02:19 +0000 |
commit | 5924ce2a2252b766fffe531fa00700ec825add90 (patch) | |
tree | f999284bdee1d1af5ba03e3a68c8d763eea2a192 /sys-cluster | |
parent | Stable on hppa (diff) | |
download | gentoo-2-5924ce2a2252b766fffe531fa00700ec825add90.tar.gz gentoo-2-5924ce2a2252b766fffe531fa00700ec825add90.tar.bz2 gentoo-2-5924ce2a2252b766fffe531fa00700ec825add90.zip |
Initial commit. Shared package for openpbs/torque init scripts and stuff.
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-cluster')
-rw-r--r-- | sys-cluster/openpbs-common/ChangeLog | 10 | ||||
-rw-r--r-- | sys-cluster/openpbs-common/Manifest | 4 | ||||
-rw-r--r-- | sys-cluster/openpbs-common/files/digest-openpbs-common-1.0.0 | 0 | ||||
-rw-r--r-- | sys-cluster/openpbs-common/files/pbs-conf.d | 12 | ||||
-rw-r--r-- | sys-cluster/openpbs-common/files/pbs-init.d | 114 | ||||
-rw-r--r-- | sys-cluster/openpbs-common/metadata.xml | 5 | ||||
-rw-r--r-- | sys-cluster/openpbs-common/openpbs-common-1.0.0.ebuild | 23 |
7 files changed, 168 insertions, 0 deletions
diff --git a/sys-cluster/openpbs-common/ChangeLog b/sys-cluster/openpbs-common/ChangeLog new file mode 100644 index 000000000000..5b92ae4228d9 --- /dev/null +++ b/sys-cluster/openpbs-common/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for sys-cluster/openpbs-common +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openpbs-common/ChangeLog,v 1.1 2005/07/05 20:02:19 robbat2 Exp $ + +*openpbs-common-1.0.0 (05 Jul 2005) + + 05 Jul 2005; Robin H. Johnson <robbat2@gentoo.org> +files/pbs-conf.d, + +files/pbs-init.d, +openpbs-common-1.0.0.ebuild, +metadata.xml: + Initial commit. Shared package for openpbs/torque init scripts and stuff. + diff --git a/sys-cluster/openpbs-common/Manifest b/sys-cluster/openpbs-common/Manifest new file mode 100644 index 000000000000..989423393413 --- /dev/null +++ b/sys-cluster/openpbs-common/Manifest @@ -0,0 +1,4 @@ +MD5 f3890ac1612162b3a919c2839d4dc489 openpbs-common-1.0.0.ebuild 546 +MD5 cfb199330d75f94a15402a9d9f3bdff2 files/pbs-conf.d 448 +MD5 47ee3396eff14ab1876fbcb8d817a035 files/pbs-init.d 2622 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-openpbs-common-1.0.0 0 diff --git a/sys-cluster/openpbs-common/files/digest-openpbs-common-1.0.0 b/sys-cluster/openpbs-common/files/digest-openpbs-common-1.0.0 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sys-cluster/openpbs-common/files/digest-openpbs-common-1.0.0 diff --git a/sys-cluster/openpbs-common/files/pbs-conf.d b/sys-cluster/openpbs-common/files/pbs-conf.d new file mode 100644 index 000000000000..86a1dc76c814 --- /dev/null +++ b/sys-cluster/openpbs-common/files/pbs-conf.d @@ -0,0 +1,12 @@ +# /etc/conf.d/pbs +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# Set this to 1 if you want to run both MOM and the server on the same machine. +# Set it to 0 if you don't want to run any jobs on your head/master. +#PBS_SERVER_AND_MOM=0 +PBS_SERVER_AND_MOM=1 + +# Uncomment the next 2 lines to use the maui scheduler +#PBS_SCHEDULER=maui +#PBS_SCHEDULER_PID=/usr/spool/maui/maui.pid diff --git a/sys-cluster/openpbs-common/files/pbs-init.d b/sys-cluster/openpbs-common/files/pbs-init.d new file mode 100644 index 000000000000..ea7532c7d886 --- /dev/null +++ b/sys-cluster/openpbs-common/files/pbs-init.d @@ -0,0 +1,114 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +opts="start stop restart" + +SERVERPID="/usr/spool/PBS/server_priv/server.lock" +MOMPID="/usr/spool/PBS/mom_priv/mom.lock" +SCHEDULER="${PBS_SCHEDULER:=pbs_sched}" +SCHEDPATH="`which ${SCHEDULER}`" +SCHEDFILE="`basename ${SCHEDPATH}`" +SCHEDPID="${PBS_SCHEDULER_PID:=/usr/spool/PBS/sched_priv/sched.lock}" + +depend() { + need net +} + +checkconfig() { + + HOSTNAME="`hostname`" + + if [ ! -e /usr/spool/PBS/server_name ] ; then + eerror "Missing config file /usr/spool/PBS/server_name" + return 1 + else + PBS_SERVER_NAME="`cat /usr/spool/PBS/server_name`" + if [ "x${HOSTNAME}" == "x${PBS_SERVER_NAME}" ] ; then + PBS_START_SERVER=1; + else + PBS_START_SERVER=0; + fi + fi + + if [ ! -e /usr/spool/PBS/mom_priv/config ] ; then + eerror "Missing config file /usr/spool/PBS/mom_priv/config" + return 1 + elif [ "${PBS_START_SERVER}" -eq 1 ] ; then + PBS_START_MOM="${PBS_SERVER_AND_MOM:=1}" + else + PBS_START_MOM="1" + fi + + if [ "${PBS_START_SERVER}" -eq 1 ] ; then + if [ ! -e /usr/spool/PBS/server_priv/nodes ] ; then + eerror "The startup script has detected this node is a server" + eerror "from the file /usr/spool/PBS/server_name," + eerror "but the config file /usr/spool/PBS/server_priv/nodes is missing" + return 1 + fi + fi + + if [ "${PBS_START_SERVER}" -eq 1 ] ; then + if [ -z "${SCHEDFILE}" ]; then + eerror "No scheduler defined and can't find pbs_sched" + return 1 + elif [ ! -x ${SCHEDPATH} ] ; then + eerror "Scheduler defined but can't be executed" + return 1 + fi + fi +} + +start() { + checkconfig || return 1 + + if [ "${PBS_START_MOM}" -gt 0 ] ; then + ebegin "Starting pbs_mom" + start-stop-daemon --start --pidfile ${MOMPID} \ + --startas /usr/sbin/pbs_mom + fi + + if [ "${PBS_START_SERVER}" -gt 0 ] ; then + ebegin "Starting pbs_server" + start-stop-daemon --start --quiet --pidfile ${SERVERPID} \ + --startas /usr/sbin/pbs_server + + ebegin "Starting ${SCHEDFILE}" + start-stop-daemon --start --quiet --pidfile ${SCHEDPID} \ + --startas ${SCHEDPATH} + fi + + eend $? +} + +stop() { + checkconfig || return 1 + + ret1=0 + ret2=0 + ret3=0 + if [ -e ${MOMPID} ] ; then + ebegin "Stopping pbs_mom" + start-stop-daemon --stop --pidfile ${MOMPID} + ret1=$? + rm -f ${MOMPID} + fi + + if [ -e ${SERVERPID} ] ; then + ebegin "Stopping pbs_server" + qterm -t immediate + ret2=$? + rm -f ${SERVERPID} + fi + + if [ -e ${SCHEDPID} ] ; then + ebegin "Stopping ${SCHEDFILE}" + start-stop-daemon --stop --pidfile ${SCHEDPID} + ret3=$? + rm -f ${SCHEDPID} + fi + + let ret=$(( $ret1 + $ret2 + $ret3 )) + eend $ret +} diff --git a/sys-cluster/openpbs-common/metadata.xml b/sys-cluster/openpbs-common/metadata.xml new file mode 100644 index 000000000000..348e6c4de815 --- /dev/null +++ b/sys-cluster/openpbs-common/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>cluster</herd> +</pkgmetadata> diff --git a/sys-cluster/openpbs-common/openpbs-common-1.0.0.ebuild b/sys-cluster/openpbs-common/openpbs-common-1.0.0.ebuild new file mode 100644 index 000000000000..628c80694679 --- /dev/null +++ b/sys-cluster/openpbs-common/openpbs-common-1.0.0.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openpbs-common/openpbs-common-1.0.0.ebuild,v 1.1 2005/07/05 20:02:19 robbat2 Exp $ + +inherit eutils + +DESCRIPTION="Shared files for all OpenPBS implementations in Gentoo" +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" +LICENSE="GPL-2" + +SLOT="0" +KEYWORDS="~x86 ~amd64 ~ppc" +IUSE="" + +DEPEND="" +RDEPEND="virtual/pbs" + + +src_install() { + newinitd ${FILESDIR}/pbs-init.d pbs + newconfd ${FILESDIR}/pbs-conf.d pbs +} |