incubator-bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r1173878 - in /incubator/bigtop/trunk/bigtop-packages/src: common/oozie/ common/sqoop/ common/zookeeper/ deb/flume/ deb/hadoop/ deb/hive/ rpm/flume/SOURCES/ rpm/flume/SPECS/ rpm/hadoop/SOURCES/ rpm/hadoop/SPECS/ rpm/hbase/SOURCES/ rpm/hbase...
Date Wed, 21 Sep 2011 21:44:26 GMT
Author: rvs
Date: Wed Sep 21 21:44:25 2011
New Revision: 1173878

URL: http://svn.apache.org/viewvc?rev=1173878&view=rev
Log:
BIGTOP-102. daemons need to be taken care of when packages are installed/upgraded/uninstalled

Added:
    incubator/bigtop/trunk/bigtop-packages/src/deb/flume/service-init.d.tpl
      - copied, changed from r1173183, incubator/bigtop/trunk/bigtop-packages/src/deb/flume/flume-node.init
Removed:
    incubator/bigtop/trunk/bigtop-packages/src/deb/flume/flume-master.init
    incubator/bigtop/trunk/bigtop-packages/src/deb/flume/flume-node.init
    incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/service-postinst.tpl
    incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/service-postrm.tpl
    incubator/bigtop/trunk/bigtop-packages/src/deb/hive/service-postinst.tpl
    incubator/bigtop/trunk/bigtop-packages/src/deb/hive/service-postrm.tpl
Modified:
    incubator/bigtop/trunk/bigtop-packages/src/common/oozie/oozie.init
    incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh
    incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh.suse
    incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh
    incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh.suse
    incubator/bigtop/trunk/bigtop-packages/src/deb/flume/rules
    incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/rules
    incubator/bigtop/trunk/bigtop-packages/src/deb/hive/rules
    incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d
    incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d.suse
    incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SPECS/flume.spec
    incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl
    incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl.suse
    incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
    incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh
    incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh.suse
    incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SPECS/hbase.spec
    incubator/bigtop/trunk/bigtop-packages/src/rpm/oozie/SPECS/oozie.spec
    incubator/bigtop/trunk/bigtop-packages/src/rpm/sqoop/SPECS/sqoop.spec
    incubator/bigtop/trunk/bigtop-packages/src/rpm/zookeeper/SPECS/zookeeper.spec

Modified: incubator/bigtop/trunk/bigtop-packages/src/common/oozie/oozie.init
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/common/oozie/oozie.init?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/common/oozie/oozie.init (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/common/oozie/oozie.init Wed Sep 21 21:44:25
2011
@@ -87,7 +87,15 @@ case "$1" in
         start_oozie
         exit 0
         ;;
-  restart|reload|force-reload)
+  force-reload|condrestart|try-restart)
+        is_oozie_alive
+        if [ ${STATUS} -eq 0 ] ; then
+          stop_oozie
+          start_oozie
+        fi
+        exit 0
+        ;;
+  restart|reload)
         stop_oozie
         start_oozie
         exit 0
@@ -118,7 +126,7 @@ case "$1" in
         esac 
         ;;
   *)
-        echo "Usage: $0 start|stop|status|restart|reload|force-reload" >&2
+        echo "Usage: $0 start|stop|status|restart|reload|force-reload|condrestart|try-restart"
>&2
         exit 3
         ;;
 esac

Modified: incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh Wed Sep 21
21:44:25 2011
@@ -142,19 +142,10 @@ case "$1" in
         fi
 	rm $PID_FILE
 	;;
-    force-reload)
+    force-reload|condrestart|try-restart)
   # check whether $DAEMON is running. If so, restart
         hadoop_check_pidfile $PID_FILE && $0 restart
 	;;
-    restart)
-        echo -n "Restarting $DESC: "
-        stop
-        [ -n "$DODTIME" ] && sleep $DODTIME
-        $0 start
-	;;
-
-
-
     restart|reload)
         echo -n "Restarting $DESC: "
         stop
@@ -173,7 +164,7 @@ case "$1" in
 
     *)
 	N=/etc/init.d/$NAME
-	echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload|status|force-stop|condrestart|try-restart}"
>&2
 	exit 1
 	;;
 esac

Modified: incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh.suse
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh.suse?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh.suse (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/common/sqoop/sqoop-metastore.sh.suse Wed Sep
21 21:44:25 2011
@@ -132,7 +132,7 @@ case "$1" in
     condrestart
     ;;
   *)
-    echo $"Usage: $0 {start|stop|status|restart|try-restart}"
+    echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
     exit 1
 esac
 

Modified: incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh Wed Sep
21 21:44:25 2011
@@ -137,19 +137,10 @@ case "$1" in
             echo " ERROR."
         fi
 	;;
-    force-reload)
+    force-reload|condrestart|try-restart)
   # check wether $DAEMON is running. If so, restart
         hadoop_check_pidfile $PID_FILE && $0 restart
 	;;
-    restart)
-        echo -n "Restarting $DESC: "
-        stop
-        [ -n "$DODTIME" ] && sleep $DODTIME
-        $0 start
-	;;
-
-
-
     restart|reload)
         echo -n "Restarting $DESC: "
         stop
@@ -169,7 +160,7 @@ case "$1" in
     *)
 	N=/etc/init.d/$NAME
   # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
-	echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload|status|force-stop|condrestart|try-restart}"
>&2
 
 	exit 1
 	;;

Modified: incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh.suse
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh.suse?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh.suse (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/common/zookeeper/hadoop-zookeeper.sh.suse Wed
Sep 21 21:44:25 2011
@@ -120,7 +120,7 @@ case "$1" in
     condrestart
     ;;
   *)
-    echo $"Usage: $0 {start|stop|status|restart|try-restart}"
+    echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
     exit 1
 esac
 

Modified: incubator/bigtop/trunk/bigtop-packages/src/deb/flume/rules
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/deb/flume/rules?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/deb/flume/rules (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/deb/flume/rules Wed Sep 21 21:44:25 2011
@@ -46,8 +46,11 @@ build-indep-stamp: patch-stamp
 	tar cf - --exclude=debian/\* . | (cd debian/tmp && tar xf -)
 	touch $@
 
+master node: debian/service-init.d.tpl
+	sed -e 's#@FLUME_DAEMON@#$@#g' $< > debian/flume-$@.init
+
 install: install-indep
-install-indep:	
+install-indep:	master node
 	dh_testdir
 	dh_testroot
 #	ant package

Copied: incubator/bigtop/trunk/bigtop-packages/src/deb/flume/service-init.d.tpl (from r1173183,
incubator/bigtop/trunk/bigtop-packages/src/deb/flume/flume-node.init)
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/deb/flume/service-init.d.tpl?p2=incubator/bigtop/trunk/bigtop-packages/src/deb/flume/service-init.d.tpl&p1=incubator/bigtop/trunk/bigtop-packages/src/deb/flume/flume-node.init&r1=1173183&r2=1173878&rev=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/deb/flume/flume-node.init (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/deb/flume/service-init.d.tpl Wed Sep 21 21:44:25
2011
@@ -16,26 +16,26 @@
 # limitations under the License.
 #
 ### BEGIN INIT INFO
-# Provides:             flume-node
+# Provides:             flume-@FLUME_DAEMON@
 # Required-Start:       $local_fs $remote_fs $syslog $named $network $time
 # Required-Stop:        $local_fs $remote_fs $syslog $named $network
 # Default-Start:        2 3 4 5
 # Default-Stop:         0 1 6
-# Short-Description:    Cloudera Flume Node
+# Short-Description:    Apache Flume @FLUME_DAEMON@
 ### END INIT INFO
-# Starts a Flume node
+# Starts a Flume @FLUME_DAEMON@
 #
-# description: Flume node
+# description: Flume @FLUME_DAEMON@
 
 
 export FLUME_HOME=/usr/lib/flume
 export FLUME_LOG_DIR=/var/log/flume
 export FLUME_RUN=/var/run/flume
-export FLUME_PID=${FLUME_RUN}/flume-flume-node.pid
+export FLUME_PID=${FLUME_RUN}/flume-flume-@FLUME_DAEMON@.pid
 export DOTIME=3
 install -d -m 0755 -o flume -g flume ${FLUME_RUN}
 
-desc="Flume node daemon"
+desc="Flume @FLUME_DAEMON@ daemon"
 
 
 # Checks if the given pid represents a live process.
@@ -65,14 +65,14 @@ flume_check_pidfile() {
 
 
 start() {
-  echo -n $"Starting $desc (flume-node): "
-  su -s /bin/sh  flume -c '${FLUME_HOME}/bin/flume-daemon.sh start node'
+  echo -n $"Starting $desc (flume-@FLUME_DAEMON@): "
+  su -s /bin/sh  flume -c '${FLUME_HOME}/bin/flume-daemon.sh start @FLUME_DAEMON@'
   echo
 }
 
 stop() {
-  echo -n $"Stopping $desc (flume-node): "
-  su -s /bin/sh  flume -c '${FLUME_HOME}/bin/flume-daemon.sh stop node'
+  echo -n $"Stopping $desc (flume-@FLUME_DAEMON@): "
+  su -s /bin/sh  flume -c '${FLUME_HOME}/bin/flume-daemon.sh stop @FLUME_DAEMON@'
   [ $? -eq 0 ] && rm -f $FLUME_PID
   echo
 }

Modified: incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/rules
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/rules?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/rules (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/deb/hadoop/rules Wed Sep 21 21:44:25 2011
@@ -73,7 +73,18 @@ install: build
 	(dh_lintian) || /bin/true
 
 
-install-indep:
+namenode_user=hdfs
+secondarynamenode_user=hdfs
+datanode_user=hdfs
+jobtracker_user=mapred
+tasktracker_user=mapred
+
+namenode secondarynamenode jobtracker tasktracker datanode: debian/service-init.d.tpl
+	sed -e "s|@HADOOP_DAEMON@|$@|" \
+            -e "s|@HADOOP_MAJOR_VERSION@|$hadoop_version|" \
+	    -e "s|@DAEMON_USER@|$($@_user)|" $< > debian/hadoop-$@.init
+
+install-indep: namenode secondarynamenode jobtracker tasktracker datanode
 	mkdir -p debian/tmp/etc/default
 	cp debian/hadoop.default debian/tmp/etc/default/hadoop
 
@@ -86,10 +97,6 @@ install-indep:
 	rm -Rf debian/hadoop/usr/bin/hadoop-fuse-dfs
 	rm -Rf debian/hadoop/usr/lib/hadoop/contrib/fuse-dfs
 
-
-# Init scripts
-	sh -x  debian/install_init_scripts.sh
-
 install-arch:
 	mkdir -p debian/tmp/etc/default
 	cp debian/hadoop-fuse.default debian/tmp/etc/default/hadoop-fuse
@@ -112,7 +119,7 @@ binary-common:  
 #	dh_installpam
 #	dh_installmime
 #	dh_python
-#	dh_installinit
+	dh_installinit
 #	dh_installcron
 #	dh_installinfo
 	dh_installman

Modified: incubator/bigtop/trunk/bigtop-packages/src/deb/hive/rules
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/deb/hive/rules?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/deb/hive/rules (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/deb/hive/rules Wed Sep 21 21:44:25 2011
@@ -37,8 +37,11 @@ build-indep-stamp:
 	bash debian/do-component-build -Divy.home=`pwd`/debian/.ivy
 	touch $@
 
+server metastore: debian/service-init.d.tpl
+	sed -e "s|@HIVE_DAEMON@|$@|" $< > debian/hadoop-hive-$@.init
+
 install: install-indep
-install-indep:	
+install-indep: metastore server	
 	dh_testdir
 	dh_testroot
 	dh_clean -k -i
@@ -52,7 +55,6 @@ install-indep:	
 	  --python-dir=debian/python-hive/usr/share/python-support/python-hive/hive
 	dh_pysupport
 	dh_install -i
-	sh debian/install_init_scripts.sh
 	ls -ld debian/hadoop-hive/var/lib/hive/metastore
 	(dh_lintian) || /bin/true
 
@@ -69,7 +71,7 @@ binary-common:	
 #	dh_installpam
 #	dh_installmime
 #	dh_python
-#	dh_installinit
+	dh_installinit
 #	dh_installcron
 #	dh_installinfo
 	dh_installman

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d Wed Sep 21 21:44:25
2011
@@ -79,8 +79,12 @@ case "$1" in
   restart)
     restart
     ;;
+  force-reload|condrestart|try-restart)
+    checkstatus
+    [ $RETVAL -eq 0 ] && restart
+    ;;
   *)
-    echo $"Usage: $0 {start|stop|restart}"
+    echo $"Usage: $0 {start|stop|restart|force-reload|condrestart|try-restart}"
     exit 1
 esac
 

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d.suse
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d.suse?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d.suse (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SOURCES/init.d.suse Wed Sep 21 21:44:25
2011
@@ -121,7 +121,7 @@ case "$1" in
     condrestart
     ;;
   *)
-    echo $"Usage: $0 {start|stop|status|restart|try-restart}"
+    echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
     exit 1
 esac
 

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SPECS/flume.spec
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SPECS/flume.spec?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SPECS/flume.spec (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/flume/SPECS/flume.spec Wed Sep 21 21:44:25
2011
@@ -178,9 +178,13 @@ fi
 chkconfig --add %{name}-%1 \
 \
 %preun %1 \
-if [ "$1" = 0 ] ; then \
-        service %{name}-%1 stop > /dev/null \
+if [ $1 = 0 ] ; then \
+        service %{name}-%1 stop > /dev/null 2>&1 \
         chkconfig --del %{name}-%1 \
+fi \
+%postun %1 \
+if [ $1 -ge 1 ]; then \
+        service %{name}-%1 condrestart >/dev/null 2>&1 \
 fi
 %service_macro node
 %service_macro master

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl Wed Sep
21 21:44:25 2011
@@ -123,11 +123,11 @@ hadoopservice() {
           DAEMON_FLAGS=-$1 $0 start
           RETVAL=$?
         else
-          echo $"Usage: $0 {start|stop|status|restart|try-restart|upgrade|rollback}"
+          echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart|upgrade|rollback}"
           exit 1
         fi
       else
-        echo $"Usage: $0 {start|stop|status|restart|try-restart}"
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
         exit 1
       fi
   esac

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl.suse
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl.suse?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl.suse (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SOURCES/hadoop-init.tmpl.suse Wed
Sep 21 21:44:25 2011
@@ -170,11 +170,11 @@ hadoopservice() {
           DAEMON_FLAGS=-$1 $0 start
           RETVAL=$?
         else
-          echo $"Usage: $0 {start|stop|status|restart|try-restart|upgrade|rollback}"
+          echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart|upgrade|rollback}"
           exit 1
         fi
       else
-        echo $"Usage: $0 {start|stop|status|restart|try-restart}"
+        echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
         exit 1
       fi
   esac

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec Wed Sep 21 21:44:25
2011
@@ -422,9 +422,13 @@ fi
 chkconfig --add %{name}-%1 \
 \
 %preun %1 \
-if [ "$1" = 0 ]; then \
-  service %{name}-%1 stop > /dev/null \
+if [ $1 = 0 ]; then \
+  service %{name}-%1 stop > /dev/null 2>&1 \
   chkconfig --del %{name}-%1 \
+fi \
+%postun %1 \
+if [ $1 -ge 1 ]; then \
+  service %{name}-%1 condrestart >/dev/null 2>&1 \
 fi
 %service_macro namenode
 %service_macro secondarynamenode

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh Wed Sep 21
21:44:25 2011
@@ -157,19 +157,10 @@ case "$1" in
             echo " ERROR."
         fi
 	;;
-    force-reload)
+    force-reload|condrestart|try-restart)
   # check wether $DAEMON is running. If so, restart
         hadoop_check_pidfile $PID_FILE && $0 restart
 	;;
-    restart)
-        echo -n "Restarting $DESC: "
-        stop
-        [ -n "$DODTIME" ] && sleep $DODTIME
-        $0 start
-	;;
-
-
-
     restart|reload)
         echo -n "Restarting $DESC: "
         stop
@@ -189,7 +180,7 @@ case "$1" in
     *)
 	N=/etc/init.d/$NAME
   # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
-	echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload|status|force-stop|condrestart|try-restart}"
>&2
 
 	exit 1
 	;;

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh.suse
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh.suse?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh.suse (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SOURCES/hadoop-hbase.sh.suse Wed
Sep 21 21:44:25 2011
@@ -126,7 +126,7 @@ case "$1" in
     condrestart
     ;;
   *)
-    echo $"Usage: $0 {start|stop|status|restart|try-restart}"
+    echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
     exit 1
 esac
 

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SPECS/hbase.spec
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SPECS/hbase.spec?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SPECS/hbase.spec (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/hbase/SPECS/hbase.spec Wed Sep 21 21:44:25
2011
@@ -226,9 +226,13 @@ getent passwd hbase 2>&1 > /dev/null || 
 chkconfig --add %{name}-%1 \
 \
 %preun %1 \
-if [ "$1" = 0 ] ; then \
-	service %{name}-%1 stop > /dev/null \
-	chkconfig --del %{name}-%1 \
+if [ $1 = 0 ] ; then \
+        service %{name}-%1 stop > /dev/null 2>&1 \
+        chkconfig --del %{name}-%1 \
+fi \
+%postun %1 \
+if [ $1 -ge 1 ]; then \
+        service %{name}-%1 condrestart >/dev/null 2>&1 \
 fi
 %service_macro master
 %service_macro thrift

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/oozie/SPECS/oozie.spec
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/oozie/SPECS/oozie.spec?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/oozie/SPECS/oozie.spec (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/oozie/SPECS/oozie.spec Wed Sep 21 21:44:25
2011
@@ -131,6 +131,11 @@ if [ "$1" = 0 ]; then
   /sbin/chkconfig --del oozie
 fi
 
+%postun
+if [ $1 -ge 1 ]; then
+  /sbin/service oozie condrestart > /dev/null
+fi
+
 %files 
 %defattr(-,root,root)
 %{lib_oozie}/bin/addtowar.sh

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/sqoop/SPECS/sqoop.spec
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/sqoop/SPECS/sqoop.spec?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/sqoop/SPECS/sqoop.spec (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/sqoop/SPECS/sqoop.spec Wed Sep 21 21:44:25
2011
@@ -107,8 +107,15 @@ getent passwd sqoop > /dev/null || usera
 chkconfig --add sqoop-metastore
 
 %preun metastore
-service sqoop-metastore stop
-chkconfig --del sqoop-metastore
+if [ $1 = 0 ] ; then
+  service sqoop-metastore stop > /dev/null 2>&1
+  chkconfig --del sqoop-metastore
+fi
+
+%postun metastore
+if [ $1 -ge 1 ]; then
+  service sqoop-metastore condrestart > /dev/null 2>&1
+fi
 
 %files metastore
 %attr(0755,root,root) %{initd_dir}/sqoop-metastore

Modified: incubator/bigtop/trunk/bigtop-packages/src/rpm/zookeeper/SPECS/zookeeper.spec
URL: http://svn.apache.org/viewvc/incubator/bigtop/trunk/bigtop-packages/src/rpm/zookeeper/SPECS/zookeeper.spec?rev=1173878&r1=1173877&r2=1173878&view=diff
==============================================================================
--- incubator/bigtop/trunk/bigtop-packages/src/rpm/zookeeper/SPECS/zookeeper.spec (original)
+++ incubator/bigtop/trunk/bigtop-packages/src/rpm/zookeeper/SPECS/zookeeper.spec Wed Sep
21 21:44:25 2011
@@ -154,8 +154,15 @@ fi
 	chkconfig --add hadoop-zookeeper-server
 
 %preun server
-	service hadoop-zookeeper-server stop
+if [ $1 = 0 ] ; then
+	service hadoop-zookeeper-server stop > /dev/null 2>&1
 	chkconfig --del hadoop-zookeeper-server
+fi
+
+%postun server
+if [ $1 -ge 1 ]; then
+        service hadoop-zookeeper-server condrestart > /dev/null 2>&1
+fi
 
 %files server
 	%attr(0755,root,root) %{initd_dir}/hadoop-zookeeper-server



Mime
View raw message