diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2010-07-04 10:13:04 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2010-07-04 10:13:04 +0000 |
commit | 9ec97f52f2cebbe001eb8f0c5ceb9f20aef212f7 (patch) | |
tree | 23e38bb135ee8a23ee87768b25ab1db5c041350c /app-admin/chef-solr | |
parent | Stable on amd64 wrt bug #326817 (diff) | |
download | gentoo-2-9ec97f52f2cebbe001eb8f0c5ceb9f20aef212f7.tar.gz gentoo-2-9ec97f52f2cebbe001eb8f0c5ceb9f20aef212f7.tar.bz2 gentoo-2-9ec97f52f2cebbe001eb8f0c5ceb9f20aef212f7.zip |
fix init script to set config file owner and permissions too
(Portage version: 2.2_rc67/cvs/Linux i686)
Diffstat (limited to 'app-admin/chef-solr')
-rw-r--r-- | app-admin/chef-solr/ChangeLog | 6 | ||||
-rw-r--r-- | app-admin/chef-solr/files/initd/chef-solr | 13 | ||||
-rw-r--r-- | app-admin/chef-solr/files/initd/chef-solr-indexer | 13 |
3 files changed, 19 insertions, 13 deletions
diff --git a/app-admin/chef-solr/ChangeLog b/app-admin/chef-solr/ChangeLog index ca2046a70804..b542955df4d8 100644 --- a/app-admin/chef-solr/ChangeLog +++ b/app-admin/chef-solr/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-admin/chef-solr # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-solr/ChangeLog,v 1.2 2010/07/03 12:59:55 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-solr/ChangeLog,v 1.3 2010/07/04 10:13:04 hollow Exp $ + + 04 Jul 2010; Benedikt Böhm <hollow@gentoo.org> files/initd/chef-solr, + files/initd/chef-solr-indexer: + fix init script to set config file owner and permissions too 03 Jul 2010; Benedikt Böhm <hollow@gentoo.org> chef-solr-0.9.6.ebuild: fix dependency on chef diff --git a/app-admin/chef-solr/files/initd/chef-solr b/app-admin/chef-solr/files/initd/chef-solr index 941736c1288f..1c48727f562a 100644 --- a/app-admin/chef-solr/files/initd/chef-solr +++ b/app-admin/chef-solr/files/initd/chef-solr @@ -14,17 +14,18 @@ CONFIGFILE=${CONFIGFILE:-/etc/chef/solr.rb} 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 SOLR" - fix_dir_owners + fix_owners start-stop-daemon --start --quiet --chuid ${CHEF_USER}:${CHEF_GROUP} \ --pidfile ${CHEF_SOLR_PIDFILE} --name java --exec \ ${CHEF_SOLR_BINARY} -- -d -P ${CHEF_SOLR_PIDFILE} -c ${CONFIGFILE} \ diff --git a/app-admin/chef-solr/files/initd/chef-solr-indexer b/app-admin/chef-solr/files/initd/chef-solr-indexer index b32261cf8556..09772bab0886 100644 --- a/app-admin/chef-solr/files/initd/chef-solr-indexer +++ b/app-admin/chef-solr/files/initd/chef-solr-indexer @@ -13,17 +13,18 @@ CONFIGFILE=${CONFIGFILE:-/etc/chef/solr.rb} 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 SOLR indexer" - fix_dir_owners + fix_owners start-stop-daemon --start --quiet --chuid ${CHEF_USER}:${CHEF_GROUP} \ --pidfile ${CHEF_SOLR_INDEXER_PIDFILE} --exec ${CHEF_SOLR_INDEXER_BINARY} \ -- -d -P ${CHEF_SOLR_INDEXER_PIDFILE} -L ${CHEF_SOLR_INDEXER_LOGFILE} \ |