1 |
commit: e7ba247425da003fc64610291384e96700bfe29b |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 13 07:35:56 2019 +0000 |
4 |
Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 13 07:35:56 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7ba2474 |
7 |
|
8 |
app-admin/puppetdb: fix puppetdb init |
9 |
|
10 |
Package-Manager: Portage-2.3.51, Repoman-2.3.12 |
11 |
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org> |
12 |
|
13 |
app-admin/puppetdb/files/puppetdb.initd-r2 | 64 ++++++++++++++++++++++ |
14 |
...petdb-6.1.0.ebuild => puppetdb-6.1.0-r1.ebuild} | 4 +- |
15 |
2 files changed, 66 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/app-admin/puppetdb/files/puppetdb.initd-r2 b/app-admin/puppetdb/files/puppetdb.initd-r2 |
18 |
new file mode 100644 |
19 |
index 00000000000..a59d798a638 |
20 |
--- /dev/null |
21 |
+++ b/app-admin/puppetdb/files/puppetdb.initd-r2 |
22 |
@@ -0,0 +1,64 @@ |
23 |
+#!/sbin/openrc-run |
24 |
+# Copyright 1999-2019 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+extra_commands="checkconfig" |
28 |
+ |
29 |
+LOGDIR="/var/log/puppetlabs/puppetdb" |
30 |
+RUNDIR="/run/puppetlabs/puppetdb" |
31 |
+ |
32 |
+checkconfig() { |
33 |
+ if [ ! -x $JAVA_BIN ]; then |
34 |
+ eerror "Missing JAVA_BIN." |
35 |
+ eend 1 |
36 |
+ fi |
37 |
+ if [ ! -d $INSTALL_DIR ]; then |
38 |
+ eerror "Missing INSTALL_DIR." |
39 |
+ eend 1 |
40 |
+ fi |
41 |
+ if [ ! -e $BOOTSTRAP_CONFIG ]; then |
42 |
+ eerror "Missing BOOTSTRAP_CONFIG." |
43 |
+ eend 1 |
44 |
+ fi |
45 |
+ if [ ! -e $CONFIG ]; then |
46 |
+ eerror "Missing CONFIG." |
47 |
+ eend 1 |
48 |
+ fi |
49 |
+ if [ ! -n $USER ]; then |
50 |
+ eerror "Missing USER." |
51 |
+ eend 1 |
52 |
+ fi |
53 |
+ if [ ! -n $GROUP ]; then |
54 |
+ eerror "Missing GROUP." |
55 |
+ eend 1 |
56 |
+ fi |
57 |
+ |
58 |
+ checkpath -d -m 0755 "${LOGDIR%/*}" |
59 |
+ checkpath -d -m 0755 "${RUNDIR%/*}" |
60 |
+ checkpath -d -m 0700 -o "${USER}:${GROUP}" "${LOGDIR}" |
61 |
+ checkpath -d -m 0755 -o "${USER}:${GROUP}" "${RUNDIR}" |
62 |
+ |
63 |
+ 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" |
64 |
+ EXEC="${JAVA_BIN} -XX:OnOutOfMemoryError=\"kill -9 %p\" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetlabs/puppetdb -Djava.security.egd=/dev/urandom ${JAVA_ARGS}" |
65 |
+} |
66 |
+ |
67 |
+start() { |
68 |
+ checkconfig || return 1 |
69 |
+ |
70 |
+ ebegin "Starting PuppetDB" |
71 |
+ start-stop-daemon --start -u "${USER}" -g "${GROUP}" \ |
72 |
+ -m --pidfile "${RUNDIR}/puppetdb.pid" \ |
73 |
+ -b --exec "/bin/bash" \ |
74 |
+ -- -c "exec ${EXEC} >> ${LOGDIR}/daemon.log 2>&1" |
75 |
+ local retval=$? |
76 |
+ if [ $retval -ne 0 ]; then |
77 |
+ ewarn "Error starting puppetdb." |
78 |
+ fi |
79 |
+ eend $retval |
80 |
+} |
81 |
+ |
82 |
+stop() { |
83 |
+ ebegin "Stopping PuppetDB" |
84 |
+ start-stop-daemon --stop --pidfile "${RUNDIR}/puppetdb.pid" |
85 |
+ eend $? |
86 |
+} |
87 |
|
88 |
diff --git a/app-admin/puppetdb/puppetdb-6.1.0.ebuild b/app-admin/puppetdb/puppetdb-6.1.0-r1.ebuild |
89 |
similarity index 96% |
90 |
rename from app-admin/puppetdb/puppetdb-6.1.0.ebuild |
91 |
rename to app-admin/puppetdb/puppetdb-6.1.0-r1.ebuild |
92 |
index 480aee3abe2..7e53a0186d4 100644 |
93 |
--- a/app-admin/puppetdb/puppetdb-6.1.0.ebuild |
94 |
+++ b/app-admin/puppetdb/puppetdb-6.1.0-r1.ebuild |
95 |
@@ -1,4 +1,4 @@ |
96 |
-# Copyright 1999-2018 Gentoo Authors |
97 |
+# Copyright 1999-2019 Gentoo Authors |
98 |
# Distributed under the terms of the GNU General Public License v2 |
99 |
|
100 |
EAPI=6 |
101 |
@@ -77,7 +77,7 @@ src_install() { |
102 |
newconfd ext/default puppetdb |
103 |
systemd_dounit ext/redhat/puppetdb.service |
104 |
systemd_newtmpfilesd ext/puppetdb.tmpfiles.conf puppetdb.conf |
105 |
- newinitd "${FILESDIR}/puppetdb.initd" puppetdb |
106 |
+ newinitd "${FILESDIR}/puppetdb.initd-r2" puppetdb |
107 |
# misc |
108 |
insinto /etc/logrotate.d |
109 |
newins ext/puppetdb.logrotate.conf puppetdb |