blob: 09772bab08867a62dcf7ef210957b359cbe7aedd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
depend() {
need net chef-solr
}
CHEF_SOLR_INDEXER_BINARY=${CHEF_SOLR_INDEXER_BINARY:-/usr/bin/chef-solr-indexer}
CHEF_SOLR_INDEXER_PIDFILE=${CHEF_SOLR_INDEXER_PIDFILE:-/var/run/chef/solr-indexer.pid}
CHEF_SOLR_INDEXER_LOGFILE=${CHEF_SOLR_INDEXER_LOGFILE:-/var/log/chef/solr-indexer.log}
CONFIGFILE=${CONFIGFILE:-/etc/chef/solr.rb}
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 SOLR indexer"
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} \
-c ${CONFIGFILE} ${CHEF_SOLR_INDEXER_OPTS}
eend $?
}
stop() {
ebegin "Shutting down Chef SOLR indexer"
start-stop-daemon --stop --quiet --pidfile ${CHEF_SOLR_INDEXER_PIDFILE}
eend $?
}
|