summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2012-12-20 09:58:28 +0000
committerBenedikt Boehm <hollow@gentoo.org>2012-12-20 09:58:28 +0000
commit788fad8367ef198c557b6164278a79fca6cbf5f3 (patch)
tree8d144b074c8d0a3e832a6fdf5f1861bc8a8919d4 /app-admin/chef-solr
parentimprove init script (diff)
downloadgentoo-2-788fad8367ef198c557b6164278a79fca6cbf5f3.tar.gz
gentoo-2-788fad8367ef198c557b6164278a79fca6cbf5f3.tar.bz2
gentoo-2-788fad8367ef198c557b6164278a79fca6cbf5f3.zip
improve init script
(Portage version: 2.2.0_alpha147/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'app-admin/chef-solr')
-rw-r--r--app-admin/chef-solr/ChangeLog7
-rw-r--r--app-admin/chef-solr/files/confd/chef-solr-indexer20
-rw-r--r--app-admin/chef-solr/files/initd/chef-solr43
-rw-r--r--app-admin/chef-solr/files/initd/chef-solr-indexer39
4 files changed, 17 insertions, 92 deletions
diff --git a/app-admin/chef-solr/ChangeLog b/app-admin/chef-solr/ChangeLog
index e930d42c3ab5..014eff809be5 100644
--- a/app-admin/chef-solr/ChangeLog
+++ b/app-admin/chef-solr/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-admin/chef-solr
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-solr/ChangeLog,v 1.12 2012/12/17 13:08:17 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-solr/ChangeLog,v 1.13 2012/12/20 09:58:28 hollow Exp $
+
+ 20 Dec 2012; Benedikt Böhm <hollow@gentoo.org>
+ -files/confd/chef-solr-indexer, -files/initd/chef-solr-indexer,
+ files/initd/chef-solr:
+ improve init script
*chef-solr-10.16.2 (17 Dec 2012)
diff --git a/app-admin/chef-solr/files/confd/chef-solr-indexer b/app-admin/chef-solr/files/confd/chef-solr-indexer
deleted file mode 100644
index 32ce4a627386..000000000000
--- a/app-admin/chef-solr/files/confd/chef-solr-indexer
+++ /dev/null
@@ -1,20 +0,0 @@
-# /etc/conf.d/chef-solr-indexer: config file for /etc/init.d/chef-solr-indexer
-
-# The configuration file to use.
-#CONFIGFILE="/etc/chef/solr.rb"
-
-# The user and group to set privilege to.
-#CHEF_USER="chef"
-#CHEF_GROUP="chef"
-
-# Log file location.
-#CHEF_SOLR_INDEXER_LOGFILE="/var/log/chef/solr-indexer.log"
-
-# Any radom options you want to pass to chef-solr-indexer.
-#CHEF_SOLR_INDEXER_OPTS=""
-
-# Path to the chef solr indexer binary.
-#CHEF_SOLR_INDEXER_BINARY="/usr/bin/chef-solr-indexer"
-
-# PID file location.
-#CHEF_SOLR_INDEXER_PIDFILE="/var/run/chef/solr-indexer.pid"
diff --git a/app-admin/chef-solr/files/initd/chef-solr b/app-admin/chef-solr/files/initd/chef-solr
index c83f60bbaa2b..b05c87b2f1bf 100644
--- a/app-admin/chef-solr/files/initd/chef-solr
+++ b/app-admin/chef-solr/files/initd/chef-solr
@@ -2,43 +2,22 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-depend() {
- need net rabbitmq
- after couchdb
-}
-
-CHEF_SOLR_BINARY=${CHEF_SOLR_BINARY:-/usr/bin/chef-solr}
-CHEF_SOLR_PIDFILE=${CHEF_SOLR_PIDFILE:-/var/run/chef/solr.pid}
CHEF_SOLR_LOGFILE=${CHEF_SOLR_LOGFILE:-/var/log/chef/solr.log}
CONFIGFILE=${CONFIGFILE:-/etc/chef/solr.rb}
-CHEF_USER=${CHEF_USER:-chef}
-CHEF_GROUP=${CHEF_GROUP:-chef}
-CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef )
+pidfile=${CHEF_SOLR_PIDFILE:-/var/run/chef/solr.pid}
+command=${CHEF_SOLR_BINARY:-/usr/bin/chef-solr}
+command_args="-d -P ${pidfile} -L ${CHEF_SOLR_LOGFILE} -c ${CONFIGFILE} ${CHEF_SOLR_OPTS}"
-fix_owners() {
- for i in ${CHEF_DIRS[@]} ${CONFIGFILE}; do
- chown ${CHEF_USER}:${CHEF_GROUP} ${i}
- done
- chmod 0600 ${CONFIGFILE}
-}
+user=${CHEF_USER:-chef}
+group=${CHEF_GROUP:-chef}
-start() {
- ebegin "Starting Chef SOLR"
- fix_owners
- start-stop-daemon --start \
- --pidfile ${CHEF_SOLR_PIDFILE} \
- --user ${CHEF_USER}:${CHEF_GROUP} \
- --name java --exec ${CHEF_SOLR_BINARY} \
- -- \
- -d -P ${CHEF_SOLR_PIDFILE} -L ${CHEF_SOLR_LOGFILE} \
- -c ${CONFIGFILE} \
- ${CHEF_SOLR_OPTS}
- eend $?
+depend() {
+ need net rabbitmq
+ after couchdb
}
-stop() {
- ebegin "Shutting down Chef SOLR"
- start-stop-daemon --stop --pidfile ${CHEF_SOLR_PIDFILE}
- eend $?
+start_pre() {
+ checkpath -q -d -m 0750 -o ${user}:${group} /etc/chef /var/{lib,log,run}/chef
+ checkpath -q -f -m 0600 ${CONFIGFILE}
}
diff --git a/app-admin/chef-solr/files/initd/chef-solr-indexer b/app-admin/chef-solr/files/initd/chef-solr-indexer
deleted file mode 100644
index 6b30113423bd..000000000000
--- a/app-admin/chef-solr/files/initd/chef-solr-indexer
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
- need net chef-solr
-}
-
-CHEF_SOLR_INDEXER_BINARY=${CHEF_SOLR_INDEXER_BINARY:-/usr/bin/chef-solr-indexer}
-CHEF_SOLR_INDEXER_PIDFILE=${CHEF_SOLR_INDEXER_PIDFILE:-/var/run/chef/solr-indexer.pid}
-CHEF_SOLR_INDEXER_LOGFILE=${CHEF_SOLR_INDEXER_LOGFILE:-/var/log/chef/solr-indexer.log}
-CONFIGFILE=${CONFIGFILE:-/etc/chef/solr.rb}
-CHEF_USER=${CHEF_USER:-chef}
-CHEF_GROUP=${CHEF_GROUP:-chef}
-
-CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef )
-
-fix_owners() {
- for i in ${CHEF_DIRS[@]} ${CONFIGFILE}; do
- chown ${CHEF_USER}:${CHEF_GROUP} ${i}
- done
- chmod 0600 ${CONFIGFILE}
-}
-
-start() {
- ebegin "Starting Chef SOLR indexer"
- fix_owners
- start-stop-daemon --start --quiet --user ${CHEF_USER} --group ${CHEF_GROUP} \
- --pidfile ${CHEF_SOLR_INDEXER_PIDFILE} --exec ${CHEF_SOLR_INDEXER_BINARY} \
- -- -d -P ${CHEF_SOLR_INDEXER_PIDFILE} -L ${CHEF_SOLR_INDEXER_LOGFILE} \
- -c ${CONFIGFILE} ${CHEF_SOLR_INDEXER_OPTS}
- eend $?
-}
-
-stop() {
- ebegin "Shutting down Chef SOLR indexer"
- start-stop-daemon --stop --quiet --pidfile ${CHEF_SOLR_INDEXER_PIDFILE}
- eend $?
-}