From ade1359978fed508f9c7178fb01bcd862590189d Mon Sep 17 00:00:00 2001 From: Benedikt Boehm Date: Sun, 4 Jul 2010 10:15:11 +0000 Subject: fix init script to set config file owner and permissions too Package-Manager: portage-2.2_rc67/cvs/Linux i686 --- app-admin/chef-server-webui/ChangeLog | 6 +++++- app-admin/chef-server-webui/files/initd/chef-server-webui | 13 +++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'app-admin/chef-server-webui') diff --git a/app-admin/chef-server-webui/ChangeLog b/app-admin/chef-server-webui/ChangeLog index 6ee9a3241eee..31df9d484f75 100644 --- a/app-admin/chef-server-webui/ChangeLog +++ b/app-admin/chef-server-webui/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-admin/chef-server-webui # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-server-webui/ChangeLog,v 1.1 2010/07/03 12:47:24 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-server-webui/ChangeLog,v 1.2 2010/07/04 10:13:57 hollow Exp $ + + 04 Jul 2010; Benedikt Böhm + files/initd/chef-server-webui: + fix init script to set config file owner and permissions too *chef-server-webui-0.9.6 (03 Jul 2010) diff --git a/app-admin/chef-server-webui/files/initd/chef-server-webui b/app-admin/chef-server-webui/files/initd/chef-server-webui index 369a4e179507..57886e3f25e5 100644 --- a/app-admin/chef-server-webui/files/initd/chef-server-webui +++ b/app-admin/chef-server-webui/files/initd/chef-server-webui @@ -15,17 +15,18 @@ CLUSTER_NODES=${CLUSTER_NODES:-1} CHEF_USER=${CHEF_USER:-chef} CHEF_GROUP=${CHEF_GROUP:-chef} -# 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[@]}} ) +CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef ) -fix_dir_owners() { - for DIR in ${CHEF_DIRS[@]} ; do chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} ; done +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_dir_owners + 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} > /dev/null -- cgit v1.2.3-65-gdbad