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


1.4
date	2012.01.29.12.22.49;	author hollow;	state Exp;
branches;
next	1.3;
commitid	1e8d4f253a184567;

1.3
date	2011.01.07.14.12.26;	author hollow;	state Exp;
branches;
next	1.2;
commitid	5d354d271f4a4567;

1.2
date	2010.07.04.10.15.11;	author hollow;	state Exp;
branches;
next	1.1;
commitid	40894c305f2f4567;

1.1
date	2010.07.03.12.42.13;	author hollow;	state Exp;
branches;
next	;
commitid	6ddd4c2f30244567;


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 couchdb rabbitmq chef-expander
	before chef-client
}

CHEF_SERVER_BINARY=${CHEF_SERVER_BINARY:-/usr/bin/chef-server}
CHEF_SERVER_PIDFILE=${CHEF_SERVER_PIDFILE:-/var/run/chef/server.%s.pid}
CHEF_SERVER_LOGFILE=${CHEF_SERVER_LOGFILE:-/var/log/chef/server.log}
CONFIGFILE=${CONFIGFILE:-/etc/chef/server.rb}
CLUSTER_NODES=${CLUSTER_NODES:-1}
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 server"
	fix_owners
	${CHEF_SERVER_BINARY} -d -P ${CHEF_SERVER_PIDFILE} -C ${CONFIGFILE} \
		-u ${CHEF_USER} -G ${CHEF_GROUP} --name chef-server \
		-c ${CLUSTER_NODES} -L ${CHEF_SERVER_LOGFILE} ${CHEF_SERVER_OPTS} > /dev/null
	eend $?
}

stop() {
	ebegin "Shutting down Chef server"
	${CHEF_SERVER_BINARY} -K all -P ${CHEF_SERVER_PIDFILE} > /dev/null
	eend $?
}
@


1.3
log
@version bump. fixes #338444

(Portage version: 2.2.0_alpha10/cvs/Linux x86_64)
@
text
@d2 1
a2 1
# Copyright 1999-2011 Gentoo Foundation
d6 1
a6 1
	need net couchdb rabbitmq chef-solr-indexer
@


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-2010 Gentoo Foundation
d32 1
a32 1
		-c ${CLUSTER_NODES} -L ${CHEF_SERVER_LOGFILE} > /dev/null
@


1.1
log
@initial ebuild, thanks to Gábor Vészi
(Portage version: 2.2_rc67/cvs/Linux i686)
@
text
@d18 1
a18 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[@@]}} )
d20 3
a22 3
fix_dir_owners() {
	for DIR in ${CHEF_DIRS[@@]}; do
		chown ${CHEF_USER}:${CHEF_GROUP} ${DIR}
d24 1
d29 1
a29 1
	fix_dir_owners
@

