summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2019-01-13 01:35:56 -0600
committerMatthew Thode <prometheanfire@gentoo.org>2019-01-13 01:35:56 -0600
commite7ba247425da003fc64610291384e96700bfe29b (patch)
tree78917e33e385898e09c52bc89f9cb35b231267a3 /app-admin/puppetdb
parentsys-apps/busybox: Version bump (v1.30.0) (diff)
downloadgentoo-e7ba247425da003fc64610291384e96700bfe29b.tar.gz
gentoo-e7ba247425da003fc64610291384e96700bfe29b.tar.bz2
gentoo-e7ba247425da003fc64610291384e96700bfe29b.zip
app-admin/puppetdb: fix puppetdb init
Package-Manager: Portage-2.3.51, Repoman-2.3.12 Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Diffstat (limited to 'app-admin/puppetdb')
-rw-r--r--app-admin/puppetdb/files/puppetdb.initd-r264
-rw-r--r--app-admin/puppetdb/puppetdb-6.1.0-r1.ebuild (renamed from app-admin/puppetdb/puppetdb-6.1.0.ebuild)4
2 files changed, 66 insertions, 2 deletions
diff --git a/app-admin/puppetdb/files/puppetdb.initd-r2 b/app-admin/puppetdb/files/puppetdb.initd-r2
new file mode 100644
index 000000000000..a59d798a6382
--- /dev/null
+++ b/app-admin/puppetdb/files/puppetdb.initd-r2
@@ -0,0 +1,64 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="checkconfig"
+
+LOGDIR="/var/log/puppetlabs/puppetdb"
+RUNDIR="/run/puppetlabs/puppetdb"
+
+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}"
+
+ JAVA_ARGS="${JAVA_ARGS} -cp '${INSTALL_DIR}/puppetdb.jar' clojure.main -m puppetlabs.puppetdb.cli.services --config ${CONFIG} -b '${BOOTSTRAP_CONFIG}' --restart-file /opt/puppetlabs/server/data/puppetdb/restartcounter"
+ EXEC="${JAVA_BIN} -XX:OnOutOfMemoryError=\"kill -9 %p\" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetlabs/puppetdb -Djava.security.egd=/dev/urandom ${JAVA_ARGS}"
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting PuppetDB"
+ start-stop-daemon --start -u "${USER}" -g "${GROUP}" \
+ -m --pidfile "${RUNDIR}/puppetdb.pid" \
+ -b --exec "/bin/bash" \
+ -- -c "exec ${EXEC} >> ${LOGDIR}/daemon.log 2>&1"
+ local retval=$?
+ if [ $retval -ne 0 ]; then
+ ewarn "Error starting puppetdb."
+ fi
+ eend $retval
+}
+
+stop() {
+ ebegin "Stopping PuppetDB"
+ start-stop-daemon --stop --pidfile "${RUNDIR}/puppetdb.pid"
+ eend $?
+}
diff --git a/app-admin/puppetdb/puppetdb-6.1.0.ebuild b/app-admin/puppetdb/puppetdb-6.1.0-r1.ebuild
index 480aee3abe2e..7e53a0186d4b 100644
--- a/app-admin/puppetdb/puppetdb-6.1.0.ebuild
+++ b/app-admin/puppetdb/puppetdb-6.1.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -77,7 +77,7 @@ src_install() {
newconfd ext/default puppetdb
systemd_dounit ext/redhat/puppetdb.service
systemd_newtmpfilesd ext/puppetdb.tmpfiles.conf puppetdb.conf
- newinitd "${FILESDIR}/puppetdb.initd" puppetdb
+ newinitd "${FILESDIR}/puppetdb.initd-r2" puppetdb
# misc
insinto /etc/logrotate.d
newins ext/puppetdb.logrotate.conf puppetdb