This way, the user is able to override the defaults if they
wish.
Signed-off-by: Chris Lalancette <[email protected]>
---
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