From: | "Benedikt Boehm (hollow)" <hollow@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in app-admin/chef-solr/files/initd: chef-solr-indexer chef-solr |
Date: | Sun, 04 Jul 2010 10:13:06 |
Message-Id: | 20100704101304.107F32CE14@corvid.gentoo.org |
1 | hollow 10/07/04 10:13:03 |
2 | |
3 | Modified: chef-solr-indexer chef-solr |
4 | Log: |
5 | fix init script to set config file owner and permissions too |
6 | (Portage version: 2.2_rc67/cvs/Linux i686) |
7 | |
8 | Revision Changes Path |
9 | 1.2 app-admin/chef-solr/files/initd/chef-solr-indexer |
10 | |
11 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr-indexer?rev=1.2&view=markup |
12 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr-indexer?rev=1.2&content-type=text/plain |
13 | diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr-indexer?r1=1.1&r2=1.2 |
14 | |
15 | Index: chef-solr-indexer |
16 | =================================================================== |
17 | RCS file: /var/cvsroot/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr-indexer,v |
18 | retrieving revision 1.1 |
19 | retrieving revision 1.2 |
20 | diff -u -r1.1 -r1.2 |
21 | --- chef-solr-indexer 3 Jul 2010 12:54:17 -0000 1.1 |
22 | +++ chef-solr-indexer 4 Jul 2010 10:13:03 -0000 1.2 |
23 | @@ -13,17 +13,18 @@ |
24 | CHEF_USER=${CHEF_USER:-chef} |
25 | CHEF_GROUP=${CHEF_GROUP:-chef} |
26 | |
27 | -# TODO: this could be nicer |
28 | -DEFAULT_CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef ) |
29 | -CHEF_DIRS=( ${CHEF_DIRS[@]:-${DEFAULT_CHEF_DIRS[@]}} ) |
30 | +CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef ) |
31 | |
32 | -fix_dir_owners() { |
33 | - for DIR in ${CHEF_DIRS[@]} ; do chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} ; done |
34 | +fix_owners() { |
35 | + for i in ${CHEF_DIRS[@]} ${CONFIGFILE}; do |
36 | + chown ${CHEF_USER}:${CHEF_GROUP} ${i} |
37 | + done |
38 | + chmod 0600 ${CONFIGFILE} |
39 | } |
40 | |
41 | start() { |
42 | ebegin "Starting Chef SOLR indexer" |
43 | - fix_dir_owners |
44 | + fix_owners |
45 | start-stop-daemon --start --quiet --chuid ${CHEF_USER}:${CHEF_GROUP} \ |
46 | --pidfile ${CHEF_SOLR_INDEXER_PIDFILE} --exec ${CHEF_SOLR_INDEXER_BINARY} \ |
47 | -- -d -P ${CHEF_SOLR_INDEXER_PIDFILE} -L ${CHEF_SOLR_INDEXER_LOGFILE} \ |
48 | |
49 | |
50 | |
51 | 1.2 app-admin/chef-solr/files/initd/chef-solr |
52 | |
53 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr?rev=1.2&view=markup |
54 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr?rev=1.2&content-type=text/plain |
55 | diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr?r1=1.1&r2=1.2 |
56 | |
57 | Index: chef-solr |
58 | =================================================================== |
59 | RCS file: /var/cvsroot/gentoo-x86/app-admin/chef-solr/files/initd/chef-solr,v |
60 | retrieving revision 1.1 |
61 | retrieving revision 1.2 |
62 | diff -u -r1.1 -r1.2 |
63 | --- chef-solr 3 Jul 2010 12:54:17 -0000 1.1 |
64 | +++ chef-solr 4 Jul 2010 10:13:03 -0000 1.2 |
65 | @@ -14,17 +14,18 @@ |
66 | CHEF_USER=${CHEF_USER:-chef} |
67 | CHEF_GROUP=${CHEF_GROUP:-chef} |
68 | |
69 | -# TODO: this could be nicer |
70 | -DEFAULT_CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef ) |
71 | -CHEF_DIRS=( ${CHEF_DIRS[@]:-${DEFAULT_CHEF_DIRS[@]}} ) |
72 | +CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef ) |
73 | |
74 | -fix_dir_owners() { |
75 | - for DIR in ${CHEF_DIRS[@]} ; do chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} ; done |
76 | +fix_owners() { |
77 | + for i in ${CHEF_DIRS[@]} ${CONFIGFILE}; do |
78 | + chown ${CHEF_USER}:${CHEF_GROUP} ${i} |
79 | + done |
80 | + chmod 0600 ${CONFIGFILE} |
81 | } |
82 | |
83 | start() { |
84 | ebegin "Starting Chef SOLR" |
85 | - fix_dir_owners |
86 | + fix_owners |
87 | start-stop-daemon --start --quiet --chuid ${CHEF_USER}:${CHEF_GROUP} \ |
88 | --pidfile ${CHEF_SOLR_PIDFILE} --name java --exec \ |
89 | ${CHEF_SOLR_BINARY} -- -d -P ${CHEF_SOLR_PIDFILE} -c ${CONFIGFILE} \ |