public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Benedikt Boehm (hollow)" <hollow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/chef-expander/files/initd: chef-expander
Date: Thu, 20 Dec 2012 09:57:36 +0000 (UTC)	[thread overview]
Message-ID: <20121220095736.49A212171E@flycatcher.gentoo.org> (raw)

hollow      12/12/20 09:57:36

  Modified:             chef-expander
  Log:
  improve init script
  
  (Portage version: 2.2.0_alpha147/cvs/Linux x86_64, unsigned Manifest commit)

Revision  Changes    Path
1.3                  app-admin/chef-expander/files/initd/chef-expander

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-expander/files/initd/chef-expander?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-expander/files/initd/chef-expander?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/chef-expander/files/initd/chef-expander?r1=1.2&r2=1.3

Index: chef-expander
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-admin/chef-expander/files/initd/chef-expander,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- chef-expander	29 Jan 2012 12:17:26 -0000	1.2
+++ chef-expander	20 Dec 2012 09:57:36 -0000	1.3
@@ -2,42 +2,21 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-depend() {
-	need net chef-solr
-}
-
-CHEF_EXPANDER_BINARY=${CHEF_EXPANDER_BINARY:-/usr/bin/chef-expander}
-CHEF_EXPANDER_PIDFILE=${CHEF_EXPANDER_PIDFILE:-/var/run/chef/expander.pid}
 CHEF_EXPANDER_LOGFILE=${CHEF_EXPANDER_LOGFILE:-/var/log/chef/expander.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 )
+pidfile=${CHEF_EXPANDER_PIDFILE:-/var/run/chef/expander.pid}
+command=${CHEF_EXPANDER_BINARY:-/usr/bin/chef-expander}
+command_args="-d -P ${pidfile} -L ${CHEF_EXPANDER_LOGFILE} -c ${CONFIGFILE} ${CHEF_EXPANDER_OPTS}"
 
-fix_owners() {
-	for i in ${CHEF_DIRS[@]} ${CONFIGFILE}; do
-		chown ${CHEF_USER}:${CHEF_GROUP} ${i}
-	done
-	chmod 0600 ${CONFIGFILE}
-}
+user=${CHEF_USER:-chef}
+group=${CHEF_GROUP:-chef}
 
-start() {
-	ebegin "Starting Chef Expander"
-	fix_owners
-	start-stop-daemon --start \
-		--pidfile ${CHEF_EXPANDER_PIDFILE} \
-		--user ${CHEF_USER}:${CHEF_GROUP} \
-		--exec ${CHEF_EXPANDER_BINARY} \
-		-- \
-		-d -P ${CHEF_EXPANDER_PIDFILE} -L ${CHEF_EXPANDER_LOGFILE} \
-		-c ${CONFIGFILE} \
-		${CHEF_EXPANDER_OPTS}
-	eend $?
+depend() {
+	need net chef-solr
 }
 
-stop() {
-	ebegin "Shutting down Chef Expander"
-	start-stop-daemon --stop --pidfile ${CHEF_EXPANDER_PIDFILE}
-	eend $?
+start_pre() {
+	checkpath -q -d -m 0750 -o ${user}:${group} /etc/chef /var/{lib,log,run}/chef
+	checkpath -q -f -m 0600 ${CONFIGFILE}
 }





             reply	other threads:[~2012-12-20  9:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20  9:57 Benedikt Boehm (hollow) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-04-25  9:00 [gentoo-commits] gentoo-x86 commit in app-admin/chef-expander/files/initd: chef-expander Hans de Graaff (graaff)
2013-02-10 20:02 Benedikt Boehm (hollow)
2012-01-29 12:17 Benedikt Boehm (hollow)
2011-07-25  9:11 Benedikt Boehm (hollow)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121220095736.49A212171E@flycatcher.gentoo.org \
    --to=hollow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox