Bug 641400

Summary: Need to daemonize the core driver and have an initscript
Product: [Retired] CloudForms Cloud Engine Reporter: Chris Lalancette <clalance>
Component: deltacloud-coreAssignee: Michal Fojtik <mfojtik>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: medium Docs Contact:
Priority: low    
Version: 0.3.1CC: cpelland, deltacloud-maint, mfojtik, rananda
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Lalancette 2010-10-08 15:32:12 UTC
Description of problem:
The deltacloudd binary that comes with the deltacloud core package needs to properly daemonize itself.  It also needs to have an initscript, an initial version of which is available in deltacloud-configure.  Once we have both of these in place, we can properly run "service deltacloud-core start", or similar, and have the log files go to a standard location (instead of STDOUT/STDERR).

Comment 1 wes hayutin 2011-01-26 17:20:27 UTC
[root@localhost log]# cat /etc/init.d/deltacloud-core
#!/bin/bash
#
#
# deltacloud-core       startup script for deltacloud-core server
#
# chkconfig: - 97 03
# description: deltacloud-core is primary server process for the \
#    Deltacloud Core component.
#

[ -r /etc/sysconfig/deltacloud-core ] && . /etc/sysconfig/deltacloud-core

ENV="${ENV:-production}"
DRIVER="${DRIVER:-ec2}"
PORT="${PORT:-3002}"
LOCKFILE="${LOCKFILE:-/var/lock/subsys/deltacloud-core }"
LOGFILE="${LOGFILE:-/var/log/deltacloud-core/$DRIVER.log}"

PROG=/usr/bin/deltacloudd

. /etc/init.d/functions

start() {
    echo -n "Starting deltacloud-core: "

    $PROG -i $DRIVER -e $ENV -p $PORT -r 0.0.0.0  >> $LOGFILE 2>&1 &
    RETVAL=$?
    if [ $RETVAL -eq 0 ] && touch $LOCKFILE ; then
      echo_success
      echo
    else
      echo_failure
      echo
    fi
}

stop() {
    echo -n "Shutting down deltacloud-core: "
    RETVAL=$?
    killall deltacloudd
    if [ $RETVAL -eq 0 ] && rm -f $LOCKFILE ; then
      echo_success
      echo
    else
      echo_failure
      echo
    fi
}

case "$1" in
    start)
      start
      ;;
    stop)
      stop
      ;;
    restart)
      stop
      start
      ;;
    reload)
      ;;
    force-reload)
      restart
      ;;
    status)
      status $PROG
      RETVAL=$?
      ;;
    *)
      echo "Usage: deltacloud-core {start|stop|restart|status}"
      exit 1
  ;;
esac

exit $RETVAL

Comment 2 Michal Fojtik 2011-02-01 10:14:33 UTC
Guys I started packaging process for Deltacloud API for Fedora and EL:

https://bugzilla.redhat.com/show_bug.cgi?id=674060

This RPM includes initscript and daemonize stuff from "support/fedora" directory.
Feel free to take it for an review.

Comment 3 wes hayutin 2011-08-01 19:53:25 UTC
release pending...

Comment 4 wes hayutin 2011-08-01 19:55:38 UTC
release pending...

Comment 6 wes hayutin 2011-12-08 13:51:06 UTC
closing out old bugs

Comment 7 wes hayutin 2011-12-08 14:04:01 UTC
perm close