Return-Path: X-Original-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC8E086CB for ; Thu, 15 Sep 2011 17:58:07 +0000 (UTC) Received: (qmail 62466 invoked by uid 500); 15 Sep 2011 17:58:07 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 62448 invoked by uid 500); 15 Sep 2011 17:58:07 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 62440 invoked by uid 99); 15 Sep 2011 17:58:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2011 17:58:07 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of clalance@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2011 17:58:00 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8FHvdCq029598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 15 Sep 2011 13:57:39 -0400 Received: from localhost.localdomain.com (dhcp-100-19-47.bos.redhat.com [10.16.19.47]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8FHvbO7026660; Thu, 15 Sep 2011 13:57:39 -0400 From: Chris Lalancette To: deltacloud-dev@incubator.apache.org Cc: clalance@redhat.com Subject: [PATCH 3/4] Clean up the initscript and the config file to honor defaults. Date: Thu, 15 Sep 2011 13:57:33 -0400 Message-Id: <1316109454-24457-4-git-send-email-clalance@redhat.com> In-Reply-To: <1316109454-24457-1-git-send-email-clalance@redhat.com> References: <1316109454-24457-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Virus-Checked: Checked by ClamAV on apache.org This way, the user is able to override the defaults if they wish. Signed-off-by: Chris Lalancette --- server/support/fedora/deltacloud-core | 19 +++++------- server/support/fedora/deltacloud-core-config | 38 +++++++++++++------------ 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/server/support/fedora/deltacloud-core b/server/support/fedora/deltacloud-core index dc7de7f..7422c59 100755 --- a/server/support/fedora/deltacloud-core +++ b/server/support/fedora/deltacloud-core @@ -26,28 +26,25 @@ prog="deltacloud-core" [ ! -d /var/log/$prog ] && mkdir -p /var/log/$prog # You can overide these variables using /etc/sysconfig/deltacloud-core -# -# ENV=production|development -# DRIVER=ec2|mock|gogrid -# -# -API_ENV="${ENV:-production}" +API_ENV="${API_ENV:-production}" DRIVER="${DRIVER:-mock}" PORT="${PORT:-3002}" +HOST="${HOST:-localhost}" +DELTACLOUD_USER="${DELTACLOUD_USER:-nobody}" LOGFILE="${LOGFILE:-/var/log/$prog/$DRIVER.log}" -lockfile="${LOCKFILE:-/var/lock/subsys/$prog}" +LOCKFILE="${LOCKFILE:-/var/lock/subsys/$prog}" [ -r $LOGFILE ] && chown nobody $LOGFILE -[ -r $lockfile ] && chown nobody $lockfile +[ -r $LOCKFILE ] && chown nobody $LOCKFILE start() { [ -x $exec ] || exit 5 echo -n $"Starting $prog: " - daemon --user nobody "$exec -i $DRIVER -e $API_ENV --port $PORT >> $LOGFILE 2>&1 &" + daemon --user "$DELTACLOUD_USER" "$exec -i $DRIVER -e $API_ENV --port $PORT -r $HOST >> $LOGFILE 2>&1 &" retval=$? - if [ $retval -eq 0 ] && touch $lockfile ; then + if [ $retval -eq 0 ] && touch $LOCKFILE ; then echo_success echo else @@ -61,7 +58,7 @@ stop() { echo -n $"Shutting down $prog: " killproc deltacloudd retval=$? - if [ $retval -eq 0 ] && rm -f $lockfile ; then + if [ $retval -eq 0 ] && rm -f $LOCKFILE ; then echo_success echo else diff --git a/server/support/fedora/deltacloud-core-config b/server/support/fedora/deltacloud-core-config index 952d8a8..51e7e7a 100644 --- a/server/support/fedora/deltacloud-core-config +++ b/server/support/fedora/deltacloud-core-config @@ -1,26 +1,28 @@ -# Deltacloud API configuration +# Deltacloud API configuration # http://deltacloud.org -# Default port where Deltacloud API will listen on (3002) -# You should be able to access Deltacloud API on http://localhost:PORT/api +# Environment under which to run deltacloud-core (default: production) +#API_ENV="production" -PORT=3002 +# Default driver to be used (mock). +# NOTE: Some drivers require some additional gems to be installed. +# Please refer to http://deltacloud.org to see what gems are needed for specific +# drivers +#DRIVER="mock" -# Bind to HOST address (default: localhost) -# You can use both IP address or hostname +# Port where deltacloud core will listen (default: localhost) +# You should be able to access Deltacloud API on http://localhost:PORT/api +#PORT="3002" -HOST=localhost +# Bind to HOST address (default: localhost) +# You can use both IP address or hostname; use 0.0.0.0 to bind to all addresses +#HOST="localhost" -# Default driver to be used (EC2). -# NOTE: Some drivers require some additional gems to be installed. -# Please reffer to http://deltacloud.org to see what gems are needed for specific -# drivers +# Default user that deltacloud core will be run under (default: nobody) +#DELTACLOUD_USER="nobody" -DRIVER="ec2" +# Default log file for deltacloud-core (default: /var/log/deltacloud-core/$DRIVER.log) +#LOGFILE="/var/log/deltacloud-core/$DRIVER.log" -# Default log file for Deltacloud API -# LOGFILE="/var/log/deltacloud-core/ec2.log" -# -# Default user under Deltacloud API will be run (default: nobody) -# -# DELTACLOUD_USER="nobody" +# Default lock file for deltacloud-core (default: /var/lock/subsys/deltacloud-core) +#LOCKFILE="/var/lock/subsys/deltacloud-core" -- 1.7.4.4