summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2019-09-23 14:18:15 -0500
committerMatthew Thode <prometheanfire@gentoo.org>2019-09-23 14:18:28 -0500
commit043d40cdb0aab8d973f675e2cf4bb853282e3b04 (patch)
tree6bae4baeaef89c9102474bb8bc1e10782aa8f224 /app-admin/puppetserver
parentwww-client/opera-beta: Version 64.0.3417.19 (diff)
downloadgentoo-043d40cdb0aab8d973f675e2cf4bb853282e3b04.tar.gz
gentoo-043d40cdb0aab8d973f675e2cf4bb853282e3b04.tar.bz2
gentoo-043d40cdb0aab8d973f675e2cf4bb853282e3b04.zip
app-admin/puppetserver: add missing class
prevented puppetserver from loading Package-Manager: Portage-2.3.69, Repoman-2.3.17 Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Diffstat (limited to 'app-admin/puppetserver')
-rw-r--r--app-admin/puppetserver/files/puppetserver.init-r172
-rw-r--r--app-admin/puppetserver/puppetserver-6.6.0-r1.ebuild (renamed from app-admin/puppetserver/puppetserver-6.6.0.ebuild)2
2 files changed, 73 insertions, 1 deletions
diff --git a/app-admin/puppetserver/files/puppetserver.init-r1 b/app-admin/puppetserver/files/puppetserver.init-r1
new file mode 100644
index 000000000000..2b7665d901a1
--- /dev/null
+++ b/app-admin/puppetserver/files/puppetserver.init-r1
@@ -0,0 +1,72 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="checkconfig reload"
+
+LOGDIR="/var/log/puppetlabs/puppetserver"
+RUNDIR="/run/puppetlabs/puppetserver"
+
+checkconfig() {
+ if [ ! -x $JAVA_BIN ]; then
+ eerror "Missing JAVA_BIN."
+ eend 1
+ fi
+ if [ ! -d $INSTALL_DIR ]; then
+ eerror "Missing INSTALL_DIR."
+ eend 1
+ fi
+ if [ ! -e $BOOTSTRAP_CONFIG ]; then
+ eerror "Missing BOOTSTRAP_CONFIG."
+ eend 1
+ fi
+ if [ ! -e $CONFIG ]; then
+ eerror "Missing CONFIG."
+ eend 1
+ fi
+ if [ ! -n $USER ]; then
+ eerror "Missing USER."
+ eend 1
+ fi
+ if [ ! -n $GROUP ]; then
+ eerror "Missing GROUP."
+ eend 1
+ fi
+
+ checkpath -d -m 0755 "${LOGDIR%/*}"
+ checkpath -d -m 0755 "${RUNDIR%/*}"
+ checkpath -d -m 0700 -o "${USER}:${GROUP}" "${LOGDIR}"
+ checkpath -d -m 0755 -o "${USER}:${GROUP}" "${RUNDIR}"
+
+ PUPPETSERVER_ARGS="-Djava.security.egd=/dev/urandom -XX:OnOutOfMemoryError=\"kill -9 %p\" -cp ${INSTALL_DIR}/puppet-server-release.jar:${INSTALL_DIR}/jruby-1_7.jar:/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter.jar clojure.main -m puppetlabs.trapperkeeper.main"
+ PUPPETSERVER_OPTS="--config /etc/puppetlabs/puppetserver/conf.d --bootstrap-config ${BOOTSTRAP_CONFIG} --restart-file /opt/puppetlabs/server/data/puppetserver/restartcounter"
+ EXEC="${JAVA_BIN} ${JAVA_ARGS} ${PUPPETSERVER_ARGS} ${PUPPETSERVER_OPTS}"
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting Puppet Server"
+ start-stop-daemon --start -u "${USER}" -g "${GROUP}" \
+ -m --pidfile "${RUNDIR}/puppetserver.pid" \
+ -b --exec "/bin/bash" \
+ -- -c "exec ${EXEC} >> ${LOGDIR}/daemon.log 2>&1"
+ local retval=$?
+ if [ $retval -ne 0 ]; then
+ ewarn "Error starting puppetserver."
+ fi
+ eend $retval
+}
+
+stop() {
+ ebegin "Stopping Puppet Server"
+ start-stop-daemon --stop --pidfile "${RUNDIR}/puppetserver.pid"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading Puppet Server"
+ start-stop-daemon --signal HUP --pidfile "${RUNDIR}/puppetserver.pid"
+ eend $?
+}
+
diff --git a/app-admin/puppetserver/puppetserver-6.6.0.ebuild b/app-admin/puppetserver/puppetserver-6.6.0-r1.ebuild
index 1b0b26fd7391..45ac7ad8e73d 100644
--- a/app-admin/puppetserver/puppetserver-6.6.0.ebuild
+++ b/app-admin/puppetserver/puppetserver-6.6.0-r1.ebuild
@@ -96,7 +96,7 @@ src_install() {
newins ext/default puppetserver
# normal init type tasks
dosym ../default/puppetserver /etc/conf.d/puppetserver
- newinitd "${FILESDIR}/puppetserver.init" puppetserver
+ newinitd "${FILESDIR}/puppetserver.init-r1" puppetserver
# misc
insinto /etc/logrotate.d
newins ext/puppetserver.logrotate.conf puppetserver