[deltacloud-core] Move the config, initscript, and startup script under version control.
Chris Lalancette
clalance at fedoraproject.org
Thu Sep 15 18:25:29 UTC 2011
commit e35153064a306f154439fbc3cb9e6e941ad25208
Author: Chris Lalancette <clalance at redhat.com>
Date: Thu Sep 15 13:18:58 2011 -0400
Move the config, initscript, and startup script under version control.
It just makes them much easier to work with.
Signed-off-by: Chris Lalancette <clalance at redhat.com>
.gitignore | 7 ---
deltacloud-core-config | 22 ++++++++++
deltacloud-core.init | 100 ++++++++++++++++++++++++++++++++++++++++++++++++
deltacloudd-fedora | 5 ++
sources | 3 -
5 files changed, 127 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b5c7d74..0342d4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,2 @@
/deltacloud-core-0.3.0.gem
-/fix_load_balancers.patch
-/deltacloudd-fedora
-/fix_rhevm_memory_calculation.patch
-/deltacloud-core-config
-/rhevm-long-username.patch
-/rhevm-long-username-fix.patch
/deltacloud-core-0.4.0.gem
-/deltacloud-core.init
diff --git a/deltacloud-core-config b/deltacloud-core-config
new file mode 100644
index 0000000..cfa7ee7
--- /dev/null
+++ b/deltacloud-core-config
@@ -0,0 +1,22 @@
+# 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
+
+PORT=3002
+
+# Bind to HOST address (default: localhost)
+# You can use both IP address or hostname
+
+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
+
+DRIVER="ec2"
+
+# Default log file for Deltacloud API
+# LOGFILE="/var/log/deltacloud-core/ec2.log"
diff --git a/deltacloud-core.init b/deltacloud-core.init
new file mode 100644
index 0000000..c645f38
--- /dev/null
+++ b/deltacloud-core.init
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# deltacloud-core Deltacloud API Core
+# chkconfig: 345 90 60
+# description: deltacloud-core is primary server process for the \
+# Deltacloud Core component.
+
+### BEGIN INIT INFO
+# Provides: deltacloud-core
+# Required-Start:
+# Required-Stop:
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Deltacloud Core API deamon
+# Description: Deltacloud Core API provides access to different cloud providers \
+# using single REST API
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+[ -r /etc/sysconfig/deltacloud-core ] && . /etc/sysconfig/deltacloud-core
+
+exec="/usr/bin/deltacloudd"
+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}"
+DRIVER="${DRIVER:-ec2}"
+PORT="${PORT:-3002}"
+LOGFILE="${LOGFILE:-/var/log/$prog/$DRIVER.log}"
+lockfile="${LOCKFILE:-/var/lock/subsys/$prog }"
+
+[ -r $LOGFILE ] && chown nobody $LOGFILE
+[ -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 &"
+ retval=$?
+
+ if [ $retval -eq 0 ] && touch $lockfile ; then
+ echo_success
+ echo
+ else
+ echo_failure
+ echo
+ fi
+ return $retval
+}
+
+stop() {
+ echo -n $"Shutting down $prog: "
+ killproc deltacloudd
+ retval=$?
+ if [ $retval -eq 0 ] && rm -f $lockfile ; then
+ echo_success
+ echo
+ else
+ echo_failure
+ echo
+ fi
+ return $retval
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ reload)
+ ;;
+ force-reload)
+ restart
+ ;;
+ status)
+ status -p $PIDFILE $prog
+ retval=$?
+ ;;
+ *)
+ echo "Usage: $prog {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+
+exit $retval
diff --git a/deltacloudd-fedora b/deltacloudd-fedora
new file mode 100644
index 0000000..2afbee4
--- /dev/null
+++ b/deltacloudd-fedora
@@ -0,0 +1,5 @@
+#!/usr/bin/ruby
+
+root_path = File.join('/', 'usr', 'share', 'deltacloud-core')
+$:.unshift File.join(root_path, 'lib')
+load File.join(root_path, 'bin', 'deltacloudd')
diff --git a/sources b/sources
index 0321247..e35ef45 100644
--- a/sources
+++ b/sources
@@ -1,4 +1 @@
-b14213ac9ea2a550db5e74c9d074c7c9 deltacloudd-fedora
-abeb7376c76aefa5090414740330124e deltacloud-core-config
d07fcd383cbd13828f26534c97a855fc deltacloud-core-0.4.0.gem
-e9487309e4c18e328e119310c712b6fb deltacloud-core.init
More information about the scm-commits
mailing list