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


1.4
date	2012.01.29.12.11.53;	author hollow;	state Exp;
branches;
next	1.3;
commitid	1aa94f2537894567;

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.4
log
@version bump wrt #396693

(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
@
text
@#!/sbin/runscript
# 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 )

fix_owners() {
	for i in ${CHEF_DIRS[@@]} ${CONFIGFILE}; do
		chown ${CHEF_USER}:${CHEF_GROUP} ${i}
	done
	chmod 0600 ${CONFIGFILE}
}

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 $?
}

stop() {
	ebegin "Shutting down Chef SOLR"
	start-stop-daemon --stop --pidfile ${CHEF_SOLR_PIDFILE}
	eend $?
}
@


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
@d2 1
a2 1
# Copyright 1999-2011 Gentoo Foundation
d29 8
a36 4
	start-stop-daemon --start --quiet --user ${CHEF_USER} --group ${CHEF_GROUP} \
		--pidfile ${CHEF_SOLR_PIDFILE} --name java --exec \
		${CHEF_SOLR_BINARY} -- -d -P ${CHEF_SOLR_PIDFILE} -c ${CONFIGFILE} \
		-L ${CHEF_SOLR_LOGFILE} ${CHEF_SOLR_OPTS} > /dev/null
d42 1
a42 1
	start-stop-daemon --stop --quiet --pidfile ${CHEF_SOLR_PIDFILE}
@


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
d29 1
a29 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
@d17 1
a17 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[@@]}} )
d19 5
a23 2
fix_dir_owners() {
	for DIR in ${CHEF_DIRS[@@]} ; do chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} ; done
d28 1
a28 1
	fix_dir_owners
@

