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


1.4
date	2012.01.29.12.34.16;	author hollow;	state Exp;
branches;
next	1.3;
commitid	287d4f253cc74567;

1.3
date	2011.01.07.14.15.08;	author hollow;	state Exp;
branches;
next	1.2;
commitid	5ece4d271fec4567;

1.2
date	2010.07.04.10.13.57;	author hollow;	state Exp;
branches;
next	1.1;
commitid	3f7d4c305ee44567;

1.1
date	2010.07.03.12.47.24;	author hollow;	state Exp;
branches;
next	;
commitid	704f4c2f315b4567;


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
	after chef-server
}

CHEF_SERVER_WEBUI_BINARY=${CHEF_SERVER_WEBUI_BINARY:-/usr/bin/chef-server-webui}
CHEF_SERVER_WEBUI_PIDFILE=${CHEF_SERVER_WEBUI_PIDFILE:-/var/run/chef/server-webui.%s.pid}
CHEF_SERVER_WEBUI_LOGFILE=${CHEF_SERVER_WEBUI_LOGFILE:-/var/log/chef/server-webui.log}
CONFIGFILE=${CONFIGFILE:-/etc/chef/webui.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 web interface"
	fix_owners
	${CHEF_SERVER_WEBUI_BINARY} -d -P ${CHEF_SERVER_WEBUI_PIDFILE} --name \
		chef-server-webui -C ${CONFIGFILE} -u ${CHEF_USER} -G ${CHEF_GROUP} \
		-c ${CLUSTER_NODES} -L ${CHEF_SERVER_WEBUI_LOGFILE} ${CHEF_SERVER_WEBUI_OPTS} > /dev/null
	eend $?
}

stop() {
	ebegin "Shutting down Chef server web interface"
	${CHEF_SERVER_WEBUI_BINARY} -K all -P ${CHEF_SERVER_WEBUI_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-2009 Gentoo Foundation
d32 1
a32 1
		-c ${CLUSTER_NODES} -L ${CHEF_SERVER_WEBUI_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 5
a24 2
fix_dir_owners() {
	for DIR in ${CHEF_DIRS[@@]} ; do chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} ; done
d29 1
a29 1
	fix_dir_owners
@

