[deltacloud-core/f16] Fixed init script

Michal Fojtik mfojtik at fedoraproject.org
Tue Mar 6 13:06:22 UTC 2012


commit 064e395086d6463058ea8d434e320421f86cef8d
Author: Michal Fojtik <mi at mifo.sk>
Date:   Tue Mar 6 14:06:12 2012 +0100

    Fixed init script

 deltacloud-core.init |   11 +++++++----
 sources              |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/deltacloud-core.init b/deltacloud-core.init
index 11df83e..c4b5644 100644
--- a/deltacloud-core.init
+++ b/deltacloud-core.init
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash -l
 #
 # deltacloud-core   Deltacloud API Core
 # chkconfig: 345 90 60
@@ -33,16 +33,19 @@ HOST="${HOST:-localhost}"
 DELTACLOUD_USER="${DELTACLOUD_USER:-nobody}"
 LOGFILE="${LOGFILE:-/var/log/$prog/$DRIVER.log}"
 LOCKFILE="${LOCKFILE:-/var/lock/subsys/$prog}"
-PIDFILE="${PIDFILE:-/var/run/deltacloud-core-$DRIVER.pid}"
+PIDFILE="${PIDFILE:-/var/run/deltacloud/deltacloud-core-$DRIVER.pid}"
 
+[[ ! -d /var/run/deltacloud ]] && mkdir /var/run/deltacloud
+chown $DELTACLOUD_USER /var/run/deltacloud
 [ -r $LOGFILE ] && chown nobody $LOGFILE
 [ -r $LOCKFILE ] && chown nobody $LOCKFILE
 
 start() {
     [ -x $exec ] || exit 5
-
+    USER=${DELTACLOUD_USER}
+    cd /
     echo -n $"Starting $prog-$DRIVER: "
-    daemon "$exec -i $DRIVER -e $API_ENV --user $DELTACLOUD_USER --daemon --pid $PIDFILE --port $PORT --host $HOST"
+    $exec -i ${DRIVER} -e ${API_ENV} --user ${DELTACLOUD_USER} --daemon --pid ${PIDFILE} --port ${PORT} --host ${HOST}
     retval=$?
 
     if [ $retval -eq 0 ] && touch $LOCKFILE ; then
diff --git a/sources b/sources
index 1a85030..a130016 100644
--- a/sources
+++ b/sources
@@ -1,9 +1,9 @@
 b14213ac9ea2a550db5e74c9d074c7c9  deltacloudd-fedora
 04d69921005cfe605aafd081d0768dae  deltacloud-core-config
-e44159c0563fdddc0b33db4fc4b4fbf3  deltacloud-core.init
 cae38c1f5f3d44c984f83be6048b1ea2  0001-EC2-Fixed-uninitialized-constant-in-valid_credential.patch
 eba525bcc9a1388b0f9581f36b9ef450  0001-EC2-We-should-return-404-instead-of-502-or-500-in-ca.patch
 e633b13203e2c4fc29c5a9bae14a61ee  0001-Improved-valid-credentials.patch
 715961a4fbdf738fef4a8a2f82b06537  0001-VSphere-Fixed-typo-in-handling-InvalidLogin-exceptio.patch
 84e06b7eec7d29a505983ecae904f3c9  0002-Core-Return-404-instead-of-exception-when-accessing-.patch
 c828f2ad3d7e61e60de5f173138eeeff  deltacloud-core-0.5.0.gem
+672faa6ebe053faf5e1765aa977088d9  deltacloud-core.init


More information about the scm-commits mailing list