cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [43/50] [abbrv] git commit: refs/heads/ui-multiple-nics - packaging: Sync RPM and DEB init scripts Agent
Date Tue, 05 Mar 2013 18:37:39 GMT
packaging: Sync RPM and DEB init scripts Agent

The RPM init script was lacking some things, it is synced
now with the DEB init script.

Both prefer Java 7 over Java 6 and add the correct JAR files to the
classpath.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/72c4d6a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/72c4d6a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/72c4d6a8

Branch: refs/heads/ui-multiple-nics
Commit: 72c4d6a87384376d6ba6e220a9d291cf798e3e61
Parents: e14e057
Author: Wido den Hollander <wido@widodh.nl>
Authored: Tue Mar 5 12:37:19 2013 +0100
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Tue Mar 5 16:10:38 2013 +0100

----------------------------------------------------------------------
 packaging/centos63/cloud-agent.rc |   94 +++++++++++++++-----------------
 packaging/debian/init/cloud-agent |    2 +-
 2 files changed, 45 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/72c4d6a8/packaging/centos63/cloud-agent.rc
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud-agent.rc b/packaging/centos63/cloud-agent.rc
index fe19da4..6d011d8 100755
--- a/packaging/centos63/cloud-agent.rc
+++ b/packaging/centos63/cloud-agent.rc
@@ -47,7 +47,7 @@ unset OPTIONS
 [ -r /etc/sysconfig/"$SHORTNAME" ] && source /etc/sysconfig/"$SHORTNAME"
 
 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT)
-JDK_DIRS="/usr/lib/jvm/jre /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64
/usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm"
+JDK_DIRS="/usr/lib/jvm/jre /usr/lib/jvm/java-7-openjdk /usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-openjdk-amd64
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk-amd64
/usr/lib/jvm/java-6-sun"
 
 for jdir in $JDK_DIRS; do
     if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
@@ -56,69 +56,63 @@ for jdir in $JDK_DIRS; do
 done
 export JAVA_HOME
 
-SCP=""
-DCP=""
 ACP=`ls /usr/share/cloudstack-agent/cloud-plugin-hypervisor-kvm-*.jar`":"`ls /usr/share/cloudstack-agent/lib/*.jar
| tr '\n' ':' | sed s'/.$//'`
-JCP="/usr/share/java/commons-daemon.jar:/usr/share/java/jna.jar"
 
 # We need to append the JSVC daemon JAR to the classpath
 # AgentShell implements the JSVC daemon methods
 # We also need JNA in the classpath (from the distribution) for the Libvirt Java bindings
-export CLASSPATH="$SCP:$DCP:$ACP:$JCP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts"
+export CLASSPATH="/usr/share/java/commons-daemon.jar:/usr/share/java/jna.jar:$ACP:/etc/cloudstack/agent:/usr/share/cloudstack-common/scripts"
 
 start() {
-        echo -n $"Starting $PROGNAME: "
-	if hostname --fqdn >/dev/null 2>&1 ; then
-		$JSVC -cp "$CLASSPATH" -pidfile "$PIDFILE" \
-		    -errfile $LOGDIR/cloudstack-agent.err -outfile $LOGDIR/cloudstack-agent.out $CLASS
-		RETVAL=$?
-		echo
-	else
-		failure
-		echo
-		echo The host name does not resolve properly to an IP address.  Cannot start "$PROGNAME".
> /dev/stderr
-		RETVAL=9
-	fi
-	[ $RETVAL = 0 ] && touch ${LOCKFILE}
-	return $RETVAL
+    echo -n $"Starting $PROGNAME: "
+    if hostname --fqdn >/dev/null 2>&1 ; then
+        $JSVC -cp "$CLASSPATH" -pidfile "$PIDFILE" -errfile SYSLOG $CLASS
+        RETVAL=$?
+        echo
+    else
+        failure
+        echo
+        echo The host name does not resolve properly to an IP address.  Cannot start "$PROGNAME".
> /dev/stderr
+        RETVAL=9
+    fi
+    [ $RETVAL = 0 ] && touch ${LOCKFILE}
+    return $RETVAL
 }
 
 stop() {
-	echo -n $"Stopping $PROGNAME: "
-	$JSVC -pidfile "$PIDFILE" -stop $CLASS
-	RETVAL=$?
-	echo
-	[ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
+    echo -n $"Stopping $PROGNAME: "
+    $JSVC -pidfile "$PIDFILE" -stop $CLASS
+    RETVAL=$?
+    echo
+    [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
 }
 
-
-# See how we were called.
 case "$1" in
-  start)
-	start
-	;;
-  stop)
-	stop
-	;;
-  status)
+    start)
+        start
+        ;;
+    stop)
+        stop
+        ;;
+    status)
         status -p ${PIDFILE} $SHORTNAME
-	RETVAL=$?
-	;;
-  restart)
-	stop
-	sleep 3
-	start
-	;;
-  condrestart)
-	if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then
-		stop
-		sleep 3
-		start
-	fi
-	;;
-  *)
-	echo $"Usage: $whatami {start|stop|restart|condrestart|status|help}"
-	RETVAL=3
+        RETVAL=$?
+        ;;
+    restart)
+        stop
+        sleep 3
+        start
+        ;;
+    condrestart)
+        if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then
+            stop
+            sleep 3
+            start
+        fi
+        ;;
+    *)
+    echo $"Usage: $whatami {start|stop|restart|condrestart|status|help}"
+    RETVAL=3
 esac
 
 exit $RETVAL

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/72c4d6a8/packaging/debian/init/cloud-agent
----------------------------------------------------------------------
diff --git a/packaging/debian/init/cloud-agent b/packaging/debian/init/cloud-agent
index a7b5244..3d9d3db 100755
--- a/packaging/debian/init/cloud-agent
+++ b/packaging/debian/init/cloud-agent
@@ -96,7 +96,7 @@ start() {
 
     wait_for_network
 
-    if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -errfile SYSLOG
-Djna.nosys=true $CLASS
+    if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" -errfile SYSLOG
$CLASS
         RETVAL=$?
     then
         rc=0


Mime
View raw message