head	1.3;
access;
symbols;
locks; strict;
comment	@# @;


1.3
date	2011.12.31.20.07.50;	author idl0r;	state Exp;
branches;
next	1.2;
commitid	4f714eff6b954567;

1.2
date	2010.07.04.10.13.03;	author hollow;	state Exp;
branches;
next	1.1;
commitid	3ed34c305eaf4567;

1.1
date	2010.07.03.12.54.17;	author hollow;	state Exp;
branches;
next	;
commitid	73414c2f32f84567;


desc
@@


1.3
log
@Revbump. Don't use deprecated start-stop-daemon options, bug 392777.

(Portage version: 2.1.10.41/cvs/Linux i686, RepoMan options: --force)
@
text
@#!/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 $?
}
@


1.2
log
@fix init script to set config file owner and permissions too
(Portage version: 2.2_rc67/cvs/Linux i686)
@
text
@d2 1
a2 1
# Copyright 1999-2009 Gentoo Foundation
d28 1
a28 1
	start-stop-daemon --start --quiet --chuid ${CHEF_USER}:${CHEF_GROUP} \
@


1.1
log
@initial ebuild, thanks to Gábor Vészi
(Portage version: 2.2_rc67/cvs/Linux i686)
@
text
@d16 1
a16 3
# TODO: this could be nicer
DEFAULT_CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef )
CHEF_DIRS=( ${CHEF_DIRS[@@]:-${DEFAULT_CHEF_DIRS[@@]}} )
d18 5
a22 2
fix_dir_owners() {
	for DIR in ${CHEF_DIRS[@@]} ; do chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} ; done
d27 1
a27 1
	fix_dir_owners
@

