diff options
author | Matthew Thode <prometheanfire@gentoo.org> | 2017-07-11 05:13:30 -0500 |
---|---|---|
committer | Matthew Thode <prometheanfire@gentoo.org> | 2017-07-11 05:21:43 -0500 |
commit | 7c9c93d88c4551f28b4c4b458e5bf3ef220d256d (patch) | |
tree | d5537634c80b99bf68cdb56ea5b96fb026561f06 | |
parent | app-admin/hddtemp: remove quote too many (diff) | |
download | gentoo-7c9c93d88c4551f28b4c4b458e5bf3ef220d256d.tar.gz gentoo-7c9c93d88c4551f28b4c4b458e5bf3ef220d256d.tar.bz2 gentoo-7c9c93d88c4551f28b4c4b458e5bf3ef220d256d.zip |
app-admin/puppetserver: fix init
Package-Manager: Portage-2.3.6, Repoman-2.3.2
-rw-r--r-- | app-admin/puppetserver/files/puppetserver.init | 72 | ||||
-rw-r--r-- | app-admin/puppetserver/puppetserver-5.0.0-r1.ebuild (renamed from app-admin/puppetserver/puppetserver-5.0.0.ebuild) | 2 |
2 files changed, 73 insertions, 1 deletions
diff --git a/app-admin/puppetserver/files/puppetserver.init b/app-admin/puppetserver/files/puppetserver.init new file mode 100644 index 000000000000..34126ed8b1e5 --- /dev/null +++ b/app-admin/puppetserver/files/puppetserver.init @@ -0,0 +1,72 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# 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 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-5.0.0.ebuild b/app-admin/puppetserver/puppetserver-5.0.0-r1.ebuild index f33b767e9cc0..4d33cdceb73a 100644 --- a/app-admin/puppetserver/puppetserver-5.0.0.ebuild +++ b/app-admin/puppetserver/puppetserver-5.0.0-r1.ebuild @@ -92,7 +92,7 @@ src_install() { fperms -R 771 /etc/puppetlabs/puppet/ssl # init type tasks newconfd ext/default puppetserver - newinitd "${FILESDIR}/puppetserver.initd" puppetserver + newinitd "${FILESDIR}/puppetserver.init" puppetserver # systemd type things insinto /etc/systemd/system/puppetserver.service.d/ newins ext/default gentoo.conf |