From 6debf3ceb99d088b5df5d11c52e94995576ebba5 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 29 Dec 2016 15:13:09 +0100 Subject: [PATCH] committing changes in /etc after emerge run Package changes: +app-admin/puppetdb-4.3.0-r1 --- .etckeeper | 12 +++++ conf.d/puppetdb | 34 +++++++++++++ init.d/puppetdb | 65 +++++++++++++++++++++++++ logrotate.d/puppetdb | 10 ++++ puppetlabs/puppetdb/bootstrap.cfg | 27 ++++++++++ puppetlabs/puppetdb/conf.d/config.ini | 16 ++++++ puppetlabs/puppetdb/conf.d/database.ini | 19 ++++++++ puppetlabs/puppetdb/conf.d/jetty.ini | 33 +++++++++++++ puppetlabs/puppetdb/conf.d/repl.ini | 9 ++++ puppetlabs/puppetdb/logback.xml | 59 ++++++++++++++++++++++ puppetlabs/puppetdb/request-logging.xml | 17 +++++++ 11 files changed, 301 insertions(+) create mode 100644 conf.d/puppetdb create mode 100755 init.d/puppetdb create mode 100644 logrotate.d/puppetdb create mode 100644 puppetlabs/puppetdb/bootstrap.cfg create mode 100644 puppetlabs/puppetdb/conf.d/config.ini create mode 100644 puppetlabs/puppetdb/conf.d/database.ini create mode 100644 puppetlabs/puppetdb/conf.d/jetty.ini create mode 100644 puppetlabs/puppetdb/conf.d/repl.ini create mode 100644 puppetlabs/puppetdb/logback.xml create mode 100644 puppetlabs/puppetdb/request-logging.xml diff --git a/.etckeeper b/.etckeeper index c614e63..7c86257 100755 --- a/.etckeeper +++ b/.etckeeper @@ -129,6 +129,7 @@ maybe chmod 0644 'conf.d/net-online' maybe chmod 0644 'conf.d/netmount' maybe chmod 0644 'conf.d/pciparm' maybe chmod 0644 'conf.d/php-fpm' +maybe chmod 0644 'conf.d/puppetdb' maybe chmod 0644 'conf.d/puppetmaster' maybe chmod 0644 'conf.d/pydoc-2.7' maybe chmod 0644 'conf.d/pydoc-3.4' @@ -435,6 +436,7 @@ maybe chmod 0755 'init.d/pciparm' maybe chmod 0755 'init.d/php-fpm' maybe chmod 0755 'init.d/procfs' maybe chmod 0755 'init.d/puppet' +maybe chmod 0755 'init.d/puppetdb' maybe chmod 0755 'init.d/puppetmaster' maybe chmod 0755 'init.d/pwcheck' maybe chmod 0755 'init.d/pydoc-2.7' @@ -513,6 +515,7 @@ maybe chmod 0644 'logrotate.d/.keep_app-admin_logrotate-0' maybe chmod 0644 'logrotate.d/apache2' maybe chmod 0644 'logrotate.d/elog-save-summary' maybe chmod 0644 'logrotate.d/openrc' +maybe chmod 0644 'logrotate.d/puppetdb' maybe chmod 0644 'logrotate.d/rsyncd' maybe chmod 0644 'logrotate.d/rsyslog' maybe chmod 0755 'lvm' @@ -775,6 +778,15 @@ maybe chmod 0755 'puppetlabs/puppet/ssl/public_keys' maybe chown 'puppet' 'puppetlabs/puppet/ssl/public_keys/berta.pixelpark.com.pem' maybe chgrp 'puppet' 'puppetlabs/puppet/ssl/public_keys/berta.pixelpark.com.pem' maybe chmod 0644 'puppetlabs/puppet/ssl/public_keys/berta.pixelpark.com.pem' +maybe chmod 0755 'puppetlabs/puppetdb' +maybe chmod 0644 'puppetlabs/puppetdb/bootstrap.cfg' +maybe chmod 0755 'puppetlabs/puppetdb/conf.d' +maybe chmod 0644 'puppetlabs/puppetdb/conf.d/config.ini' +maybe chmod 0644 'puppetlabs/puppetdb/conf.d/database.ini' +maybe chmod 0644 'puppetlabs/puppetdb/conf.d/jetty.ini' +maybe chmod 0644 'puppetlabs/puppetdb/conf.d/repl.ini' +maybe chmod 0644 'puppetlabs/puppetdb/logback.xml' +maybe chmod 0644 'puppetlabs/puppetdb/request-logging.xml' maybe chmod 0644 'rc.conf' maybe chmod 0644 'resolv.conf' maybe chmod 0644 'resolv.conf.bak' diff --git a/conf.d/puppetdb b/conf.d/puppetdb new file mode 100644 index 0000000..54f22c6 --- /dev/null +++ b/conf.d/puppetdb @@ -0,0 +1,34 @@ +########################################### +# Init settings for puppetdb +########################################### + +# Location of your Java binary (version 7 or higher) +JAVA_BIN="/usr/bin/java" + +# Modify this if you'd like to change the memory allocation, enable JMX, etc +JAVA_ARGS="-Xmx192m" + +# These normally shouldn't need to be edited if using OS packages +USER="puppetdb" +GROUP="puppetdb" +INSTALL_DIR="/opt/puppetlabs/server/apps/puppetdb" +CONFIG="/etc/puppetlabs/puppetdb/conf.d" + +# Bootstrap path +BOOTSTRAP_CONFIG="/etc/puppetlabs/puppetdb/bootstrap.cfg" + +# SERVICE_STOP_RETRIES can be set here to alter the default stop timeout in +# seconds. For systemd, the shorter of this setting or 'TimeoutStopSec' in +# the systemd.service definition will effectively be the timeout which is used. +SERVICE_STOP_RETRIES=60 + +# START_TIMEOUT can be set here to alter the default startup timeout in +# seconds. For systemd, the shorter of this setting or 'TimeoutStartSec' +# in the service's systemd.service configuration file will effectively be the +# timeout which is used. +START_TIMEOUT=300 + + +# Maximum number of seconds that can expire for a service reload attempt before +# the result of the attempt is interpreted as a failure. +RELOAD_TIMEOUT=120 diff --git a/init.d/puppetdb b/init.d/puppetdb new file mode 100755 index 0000000..1863cea --- /dev/null +++ b/init.d/puppetdb @@ -0,0 +1,65 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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.main --config ${CONFIG} -b '${BOOTSTRAP_CONFIG}'" + 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/logrotate.d/puppetdb b/logrotate.d/puppetdb new file mode 100644 index 0000000..dd05cbf --- /dev/null +++ b/logrotate.d/puppetdb @@ -0,0 +1,10 @@ +/var/log/puppetlabs/puppetdb/*.log { + weekly + missingok + rotate 12 + compress + copytruncate + notifempty + su puppetdb puppetdb + create 640 puppetdb puppetdb +} diff --git a/puppetlabs/puppetdb/bootstrap.cfg b/puppetlabs/puppetdb/bootstrap.cfg new file mode 100644 index 0000000..e1a0e5c --- /dev/null +++ b/puppetlabs/puppetdb/bootstrap.cfg @@ -0,0 +1,27 @@ +# This file is used by the application framework (trapperkeeper) to +# determine what services should be loaded at boot time. +# For more info, see: +# https://github.com/puppetlabs/trapperkeeper/wiki/Bootstrapping + +# Web Server +puppetlabs.trapperkeeper.services.webserver.jetty9-service/jetty9-service + +# Webrouting +puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service + +# TK status +puppetlabs.trapperkeeper.services.metrics.metrics-service/metrics-webservice +puppetlabs.trapperkeeper.services.status.status-service/status-service + +# PuppetDB Services +puppetlabs.puppetdb.cli.services/puppetdb-service +puppetlabs.puppetdb.command/command-service +puppetlabs.puppetdb.pdb-routing/maint-mode-service +puppetlabs.puppetdb.pdb-routing/pdb-routing-service +puppetlabs.puppetdb.config/config-service + +# NREPL +puppetlabs.trapperkeeper.services.nrepl.nrepl-service/nrepl-service + +# Dashboard redirect: remove to disable +puppetlabs.puppetdb.dashboard/dashboard-redirect-service diff --git a/puppetlabs/puppetdb/conf.d/config.ini b/puppetlabs/puppetdb/conf.d/config.ini new file mode 100644 index 0000000..4a32adf --- /dev/null +++ b/puppetlabs/puppetdb/conf.d/config.ini @@ -0,0 +1,16 @@ +# See README.md for more thorough explanations of each section and +# option. + +[global] +# Store mq/db data in a custom directory +vardir = /opt/puppetlabs/server/data/puppetdb + +# Use an external logback config file +logging-config = /etc/puppetlabs/puppetdb/logback.xml + +[command-processing] +# How many command-processing threads to use, defaults to (CPUs / 2) +# threads = 4 + +# How many threads can write to disk at once, defaults to min(CPUs / 2, 4) +# concurrent-writes = 4 diff --git a/puppetlabs/puppetdb/conf.d/database.ini b/puppetlabs/puppetdb/conf.d/database.ini new file mode 100644 index 0000000..929b7f3 --- /dev/null +++ b/puppetlabs/puppetdb/conf.d/database.ini @@ -0,0 +1,19 @@ +[database] +#classname = org.postgresql.Driver +#subprotocol = postgresql + +# The database address, i.e. //HOST:PORT/DATABASE_NAME +# subname = //localhost:5432/puppetdb + +# Connect as a specific user +# username = foobar + +# Use a specific password +# password = foobar + +# How often (in minutes) to compact the database +# gc-interval = 60 + +# Number of seconds before any SQL query is considered 'slow'; offending +# queries will not be interrupted, but will be logged at the WARN log level. +log-slow-statements = 10 diff --git a/puppetlabs/puppetdb/conf.d/jetty.ini b/puppetlabs/puppetdb/conf.d/jetty.ini new file mode 100644 index 0000000..46693fb --- /dev/null +++ b/puppetlabs/puppetdb/conf.d/jetty.ini @@ -0,0 +1,33 @@ +[jetty] +# IP address or hostname to listen for clear-text HTTP. To avoid resolution +# issues, IP addresses are recommended over hostnames. +# Default is `localhost`. +# host = + +# Port to listen on for clear-text HTTP. +port = 8080 + +# The following are SSL specific settings. They can be configured +# automatically with the tool `puppetdb ssl-setup`, which is normally +# ran during package installation. + +# IP address to listen on for HTTPS connections. Hostnames can also be used +# but are not recommended to avoid DNS resolution issues. To listen on all +# interfaces, use `0.0.0.0`. +# ssl-host = + +# The port to listen on for HTTPS connections +# ssl-port = + +# Private key path +# ssl-key = + +# Public certificate path +# ssl-cert = + +# Certificate authority path +# ssl-ca-cert = + +# Access logging configuration path. To turn off access logging +# comment out the line with `access-log-config=...` +access-log-config = /etc/puppetlabs/puppetdb/request-logging.xml diff --git a/puppetlabs/puppetdb/conf.d/repl.ini b/puppetlabs/puppetdb/conf.d/repl.ini new file mode 100644 index 0000000..e073316 --- /dev/null +++ b/puppetlabs/puppetdb/conf.d/repl.ini @@ -0,0 +1,9 @@ +[nrepl] +# Set to true to enable the remote REPL +enabled = false + +# What port the REPL should listen on +port = 8082 + +# IP address to listen on +host = 127.0.0.1 diff --git a/puppetlabs/puppetdb/logback.xml b/puppetlabs/puppetdb/logback.xml new file mode 100644 index 0000000..361b3fa --- /dev/null +++ b/puppetlabs/puppetdb/logback.xml @@ -0,0 +1,59 @@ + + + + %d %-5p [%c{2}] %m%n + + + + + /var/log/puppetlabs/puppetdb/puppetdb.log + true + + /var/log/puppetlabs/puppetdb/puppetdb-%d{yyyy-MM-dd}.%i.log.gz + + 200MB + 90 + 1GB + + + %d %-5p [%c{2}] %m%n + + + + + + + + + + + + + + /var/log/puppetlabs/puppetdb/puppetdb-status.log + true + + + /var/log/puppetlabs/puppetdb/puppetdb-status-%d{yyyy-MM-dd}.%i.log.gz + + 200MB + 90 + 1GB + + + + %m%n + + + + + + + + + + + + + diff --git a/puppetlabs/puppetdb/request-logging.xml b/puppetlabs/puppetdb/request-logging.xml new file mode 100644 index 0000000..a8301fb --- /dev/null +++ b/puppetlabs/puppetdb/request-logging.xml @@ -0,0 +1,17 @@ + + + /var/log/puppetlabs/puppetdb/puppetdb-access.log + true + + /var/log/puppetlabs/puppetdb/puppetdb-access-%d{yyyy-MM-dd}.%i.log.gz + + 200MB + 90 + 1GB + + + %h %l %u [%t] "%r" %s %b "%i{Referer}" "%i{User-Agent}" %D + + + + -- 2.39.5