From 043d40cdb0aab8d973f675e2cf4bb853282e3b04 Mon Sep 17 00:00:00 2001 From: Matthew Thode Date: Mon, 23 Sep 2019 14:18:15 -0500 Subject: [PATCH] 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 --- .../puppetserver/files/puppetserver.init-r1 | 72 +++++++++++++++++++ ....0.ebuild => puppetserver-6.6.0-r1.ebuild} | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 app-admin/puppetserver/files/puppetserver.init-r1 rename app-admin/puppetserver/{puppetserver-6.6.0.ebuild => puppetserver-6.6.0-r1.ebuild} (98%) 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 similarity index 98% rename from app-admin/puppetserver/puppetserver-6.6.0.ebuild rename to 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 -- 2.26.2