Bug 641400 - Need to daemonize the core driver and have an initscript
Summary: Need to daemonize the core driver and have an initscript
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: deltacloud-core
Version: 0.3.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
Assignee: Michal Fojtik
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-08 15:32 UTC by Chris Lalancette
Modified: 2012-01-26 12:38 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 674060 0 medium CLOSED Review Request: deltacloud-core - Deltacloud REST API 2021-02-22 00:41:40 UTC

Internal Links: 674060

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


Note You need to log in before you can comment on or make changes to this bug.