accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1423477 - in /accumulo/trunk/assemble: ./ platform/ scripts/ scripts/init.d/
Date Tue, 18 Dec 2012 15:41:39 GMT
Author: vines
Date: Tue Dec 18 15:41:38 2012
New Revision: 1423477

URL: http://svn.apache.org/viewvc?rev=1423477&view=rev
Log:
Merging ACCUMULO-792 to trunk


Added:
    accumulo/trunk/assemble/scripts/
      - copied from r1417662, accumulo/branches/1.4/src/assemble/scripts/
    accumulo/trunk/assemble/scripts/gc-only-init.sh
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/gc-only-init.sh
    accumulo/trunk/assemble/scripts/init.d/
      - copied from r1417662, accumulo/branches/1.4/src/assemble/scripts/init.d/
    accumulo/trunk/assemble/scripts/init.d/accumulo-gc
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/init.d/accumulo-gc
    accumulo/trunk/assemble/scripts/init.d/accumulo-master
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/init.d/accumulo-master
    accumulo/trunk/assemble/scripts/init.d/accumulo-monitor
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/init.d/accumulo-monitor
    accumulo/trunk/assemble/scripts/init.d/accumulo-tracer
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/init.d/accumulo-tracer
    accumulo/trunk/assemble/scripts/init.d/accumulo-tserver   (with props)
    accumulo/trunk/assemble/scripts/master-only-init.sh
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/master-only-init.sh
    accumulo/trunk/assemble/scripts/monitor-only-init.sh
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/monitor-only-init.sh
    accumulo/trunk/assemble/scripts/stand-alone-init.sh
      - copied, changed from r1417662, accumulo/branches/1.4/src/assemble/scripts/stand-alone-init.sh
    accumulo/trunk/assemble/scripts/tracer-only-init.sh
      - copied unchanged from r1417662, accumulo/branches/1.4/src/assemble/scripts/tracer-only-init.sh
    accumulo/trunk/assemble/scripts/tserver-only-init.sh   (with props)
Removed:
    accumulo/trunk/assemble/platform/
Modified:
    accumulo/trunk/assemble/   (props changed)

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src/assemble:r1417651-1417662

Added: accumulo/trunk/assemble/scripts/init.d/accumulo-tserver
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/scripts/init.d/accumulo-tserver?rev=1423477&view=auto
==============================================================================
--- accumulo/trunk/assemble/scripts/init.d/accumulo-tserver (added)
+++ accumulo/trunk/assemble/scripts/init.d/accumulo-tserver Tue Dec 18 15:41:38 2012
@@ -0,0 +1,160 @@
+#! /bin/sh
+# chkconfig: 2345 21 15
+### BEGIN INIT INFO
+# Provides:         accumulo-slave
+# Required-Start:   $network $local_fs hadoop-namenode hadoop-datanode zookeeper-server accumulo-master
+# Required-Stop:    $network $local_fs hadoop-datanode hadoop-namenode zookeeper-server accumulo-master
+# Default-Start:    2 3 4 5
+# Default-Stop:     0 1 6
+# Short-Description: accumulo tserver and logger processes
+# Description:      The accumulo slaves bundle the tserver and logger processes for accumulo
+### END INIT INFO
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Do NOT "set -e"
+install -d -m 0775 -o root -g accumulo /var/run/accumulo
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/accumulo/bin
+DESC="Accumulo Tserver"
+NAME=accumulo-tserver
+ACCUMULO_PROC=tserver
+DAEMON=/usr/lib/accumulo/bin/start-server.sh
+IP=`ifconfig | grep inet[^6] | awk '{print $2}' | sed 's/addr://' | grep -v 0.0.0.0 | grep
-v 127.0.0.1 | head -n 1`
+DAEMON_ARGS="$IP slaves"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Read configuration variable file if it is present
+[ -r /etc/default/accumulo ] && . /etc/default/accumulo
+
+# Load the VERBOSE setting and other rcS variables
+if [ -f /lib/init/vars.sh ]; then
+  . /lib/init/vars.sh
+else
+  log_daemon_msg() { logger "$@"; }
+  log_end_msg() { [ $1 -eq 0 ] && RES=OK; logger ${RES:=FAIL}; }
+fi
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+    TARGET_USER_NAME="ACCUMULO_USER"
+    TARGET_USER=$(eval "echo \$$TARGET_USER_NAME")
+	# Return
+	#  0 if daemon has been started
+	#  1 if daemon was already running
+	#  2 if daemon could not be started
+	
+  if [ "`jps -m | grep $ACCUMULO_PROC`" ] ; then return 1; fi
+
+  su -s /bin/sh $TARGET_USER -c "/usr/lib/accumulo/bin/start-server.sh $IP tserver \"tablet
server\""
+
+  if [ "`jps -m | grep $ACCUMULO_PROC`" ] ; then return 0; fi
+	return 2
+	# Add code here, if necessary, that waits for the process to be ready
+	# to handle requests from services started subsequently which depend
+	# on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+	# Return
+	#  0 if daemon has been stopped
+	#  1 if daemon was already stopped
+	#  2 if daemon could not be stopped
+	#  other if a failure occurred
+
+  if [ ! "`jps -m | grep $ACCUMULO_PROC`" ] ; then return 1; fi
+
+	su -s /bin/sh $TARGET_USER -c "/usr/lib/accumulo/bin/accumulo admin stop $IP"
+
+  if [ "`jps -m | grep $ACCUMULO_PROC`" ] ; then jps -m | grep $ACCUMULO_PROC | awk '{print
$1}' | xargs kill -9; fi
+
+  if [ "`jps -m | grep $ACCUMULO_PROC`" ] ; then return 2; fi
+	return 0;
+}
+
+case "$1" in
+  start)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  status)
+      status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+      ;;
+  #reload|force-reload)
+	#
+	# If do_reload() is not implemented then leave this commented out
+	# and leave 'force-reload' as an alias for 'restart'.
+	#
+	#log_daemon_msg "Reloading $DESC" "$NAME"
+	#do_reload
+	#log_end_msg $?
+	#;;
+  restart|force-reload)
+	#
+	# If the "reload" option is implemented then remove the
+	# 'force-reload' alias
+	#
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+	  	# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:

Propchange: accumulo/trunk/assemble/scripts/init.d/accumulo-tserver
------------------------------------------------------------------------------
    svn:executable = *

Copied: accumulo/trunk/assemble/scripts/stand-alone-init.sh (from r1417662, accumulo/branches/1.4/src/assemble/scripts/stand-alone-init.sh)
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/scripts/stand-alone-init.sh?p2=accumulo/trunk/assemble/scripts/stand-alone-init.sh&p1=accumulo/branches/1.4/src/assemble/scripts/stand-alone-init.sh&r1=1417662&r2=1423477&rev=1423477&view=diff
==============================================================================
--- accumulo/branches/1.4/src/assemble/scripts/stand-alone-init.sh (original)
+++ accumulo/trunk/assemble/scripts/stand-alone-init.sh Tue Dec 18 15:41:38 2012
@@ -23,4 +23,4 @@ fi
 ./monitor-only-init.sh
 ./tracer-only-init.sh
 ./master-only-init.sh
-./slave-only-init.sh
+./tserver-only-init.sh

Added: accumulo/trunk/assemble/scripts/tserver-only-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/scripts/tserver-only-init.sh?rev=1423477&view=auto
==============================================================================
--- accumulo/trunk/assemble/scripts/tserver-only-init.sh (added)
+++ accumulo/trunk/assemble/scripts/tserver-only-init.sh Tue Dec 18 15:41:38 2012
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ $(id -ur) -ne 0 ]; then
+  echo "This script must be run as root" 1>&2
+  exit 1
+fi
+
+if [ ! -f /etc/default/accumulo ]; then
+  mkdir -p /etc/default
+  touch /etc/default/accumulo
+fi
+
+if ! grep "ACCUMULO_USER=" /etc/default/accumulo  >> /dev/null ; then
+  echo "ACCUMULO_USER=accumulo" >> /etc/default/accumulo
+fi
+
+if ! id -u accumulo >/dev/null 2>&1; then
+  groupArg="U"
+  if egrep "^accumulo:" /etc/group >> /dev/null; then
+    groupArg="g accumulo"
+  fi
+  useradd -$groupArg -d /usr/lib/accumulo accumulo
+fi
+
+install -m 0755 -o root -g root init.d/accumulo-tserver /etc/init.d/
+if [ -e "`which update-rc.d`" ]; then 
+  update-rc.d accumulo-tserver start 21 2 3 4 5 . stop 15 0 1 6 .
+elif [ -e "`which chkconfig`" ]; then
+  chkconfig --add accumulo-tserver
+else
+  echo "No update-rc.d or chkconfig, rc levels not set for accumulo-tserver"
+fi

Propchange: accumulo/trunk/assemble/scripts/tserver-only-init.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: accumulo/trunk/assemble/scripts/tserver-only-init.sh
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message