You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2012/10/15 21:57:47 UTC
svn commit: r1398485 - in /accumulo/trunk/assemble: ./ platform/
platform/debian/ platform/debian/init.d/
Author: vines
Date: Mon Oct 15 19:57:46 2012
New Revision: 1398485
URL: http://svn.apache.org/viewvc?rev=1398485&view=rev
Log:
ACCUMULO-312 ACCUMULO-792 Merged init.d with appropriate script changes to trunk
Added:
accumulo/trunk/assemble/platform/
accumulo/trunk/assemble/platform/debian/
accumulo/trunk/assemble/platform/debian/gc-only-init.sh (with props)
accumulo/trunk/assemble/platform/debian/init.d/
accumulo/trunk/assemble/platform/debian/init.d/accumulo-gc (with props)
accumulo/trunk/assemble/platform/debian/init.d/accumulo-master (with props)
accumulo/trunk/assemble/platform/debian/init.d/accumulo-monitor (with props)
accumulo/trunk/assemble/platform/debian/init.d/accumulo-tracer (with props)
accumulo/trunk/assemble/platform/debian/init.d/accumulo-tserver (with props)
accumulo/trunk/assemble/platform/debian/master-only-init.sh (with props)
accumulo/trunk/assemble/platform/debian/monitor-only-init.sh (with props)
accumulo/trunk/assemble/platform/debian/stand-alone-init.sh (with props)
accumulo/trunk/assemble/platform/debian/tracer-only-init.sh (with props)
accumulo/trunk/assemble/platform/debian/tserver-only-init.sh (with props)
Modified:
accumulo/trunk/assemble/ (props changed)
Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Oct 15 19:57:46 2012
@@ -0,0 +1,15 @@
+/accumulo/branches/1.3/assemble:1309369,1328076,1330246,1330264,1330944,1349971,1354669
+/accumulo/branches/1.3/src/assemble:1309369,1328076,1330246,1349971,1354669
+/accumulo/branches/1.4/assemble:1305403-1382577,1382613,1388120,1388629,1393868,1396065,1396572,1396616,1396758,1396772,1397048,1397113,1397117,1397176,1397189,1397383,1397700
+/accumulo/branches/1.4/src/assemble:1305403-1356900,1358206,1363430,1364778,1365213,1376679-1388120,1396772,1397048,1397113,1397117,1397176,1397189,1397383,1397700
+/accumulo/branches/ACCUMULO-672/assemble:1357826,1357829,1357842,1357858,1358236,1359163
+/accumulo/trunk/src/assemble:1329425,1332224,1332278,1332347,1333047,1333070,1341000,1342373,1350779,1351691,1356400,1359721
+/incubator/accumulo/branches/1.3/assemble:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
+/incubator/accumulo/branches/1.3/src/assemble:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
+/incubator/accumulo/branches/1.3.5rc/assemble:1209938
+/incubator/accumulo/branches/1.3.5rc/src/assemble:1209938
+/incubator/accumulo/branches/1.4/assemble:1201902-1305402
+/incubator/accumulo/branches/1.4/src/assemble:1201899-1305402
+/incubator/accumulo/branches/1.4.0rc/assemble:1304025,1305326
+/incubator/accumulo/branches/1.4.0rc/src/assemble:1304025,1305326
+/incubator/accumulo/trunk/src/assemble:1178656-1201898,1205476,1205570,1208726,1222413,1222719,1222725,1222733-1222734,1296160-1296495
Added: accumulo/trunk/assemble/platform/debian/gc-only-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/gc-only-init.sh?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/gc-only-init.sh (added)
+++ accumulo/trunk/assemble/platform/debian/gc-only-init.sh Mon Oct 15 19:57:46 2012
@@ -0,0 +1,25 @@
+#! /bin/sh
+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-gc /etc/init.d/
+update-rc.d accumulo-gc defaults
Propchange: accumulo/trunk/assemble/platform/debian/gc-only-init.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: accumulo/trunk/assemble/platform/debian/gc-only-init.sh
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/init.d/accumulo-gc
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/init.d/accumulo-gc?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/init.d/accumulo-gc (added)
+++ accumulo/trunk/assemble/platform/debian/init.d/accumulo-gc Mon Oct 15 19:57:46 2012
@@ -0,0 +1,140 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: accumulo-gc
+# Required-Start: $network $local_fs
+# Required-Stop: $network $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: accumulo garbage collector process
+# Description: The accumulo garbage collector handles cleanup of old walogs and files in hdfs
+### END INIT INFO
+
+# Author: John Vines <jo...@sqrrl.com>
+
+# 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 Garbage Collector"
+NAME=accumulo-gc
+ACCUMULO_PROC=gc
+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 gc \"garbage collector\""
+PIDFILE=/var/run/accumulo/$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
+. /lib/init/vars.sh
+
+# 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 "$DAEMON $DAEMON_ARGS > /dev/null || return 1"
+
+ 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
+
+ jps -m | grep $ACCUMULO_PROC | awk '{print $1}' | xargs kill -9
+
+ 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/platform/debian/init.d/accumulo-gc
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/init.d/accumulo-master
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/init.d/accumulo-master?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/init.d/accumulo-master (added)
+++ accumulo/trunk/assemble/platform/debian/init.d/accumulo-master Mon Oct 15 19:57:46 2012
@@ -0,0 +1,141 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: accumulo-master
+# Required-Start: $network $local_fs hadoop-namenode zookeeper-server
+# Required-Stop: $network $local_fs accumulo-slave
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: accumulo master process
+# Description: The accumulo master manages tablet assignment and balance to accumulo
+### END INIT INFO
+
+# Author: John Vines <jo...@sqrrl.com>
+
+# 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 Master"
+NAME=accumulo-master
+ACCUMULO_PROC=master
+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 master"
+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
+. /lib/init/vars.sh
+
+# 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/accumulo org.apache.accumulo.server.master.state.SetGoalState NORMAL"
+ su -s /bin/sh $TARGET_USER -c "$DAEMON $DAEMON_ARGS > /dev/null || return 1"
+
+ 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
+
+ jps -m | grep $ACCUMULO_PROC | awk '{print $1}' | xargs kill -9
+
+ 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/platform/debian/init.d/accumulo-master
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/init.d/accumulo-monitor
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/init.d/accumulo-monitor?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/init.d/accumulo-monitor (added)
+++ accumulo/trunk/assemble/platform/debian/init.d/accumulo-monitor Mon Oct 15 19:57:46 2012
@@ -0,0 +1,140 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: accumulo-monitor
+# Required-Start: $network $local_fs
+# Required-Stop: $network $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: accumulo monitor process on 50095
+# Description: The accumulo monitor provides a convenient mechanism for monitoring accumulo
+### END INIT INFO
+
+# Author: John Vines <jo...@sqrrl.com>
+
+# 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 Monitor"
+NAME=accumulo-monitor
+ACCUMULO_PROC=monitor
+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 monitor"
+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
+. /lib/init/vars.sh
+
+# 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_MONITOR_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 "$DAEMON $DAEMON_ARGS > /dev/null || return 1"
+
+ 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
+
+ jps -m | grep $ACCUMULO_PROC | awk '{print $1}' | xargs kill -9
+
+ 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/platform/debian/init.d/accumulo-monitor
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/init.d/accumulo-tracer
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/init.d/accumulo-tracer?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/init.d/accumulo-tracer (added)
+++ accumulo/trunk/assemble/platform/debian/init.d/accumulo-tracer Mon Oct 15 19:57:46 2012
@@ -0,0 +1,140 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: accumulo-tracer
+# Required-Start: $network $local_fs zookeeper-server
+# Required-Stop: $network $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: accumulo tracer
+# Description: The accumulo tracer provides a mechanism for tracing accumulo calls
+### END INIT INFO
+
+# Author: John Vines <jo...@sqrrl.com>
+
+# 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 Tracer"
+NAME=accumulo-tracer
+ACCUMULO_PROC=tracer
+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 tracer"
+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
+. /lib/init/vars.sh
+
+# 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_TRACER_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 "$DAEMON $DAEMON_ARGS > /dev/null || return 1"
+
+ 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
+
+ jps -m | grep $ACCUMULO_PROC | awk '{print $1}' | xargs kill -9
+
+ 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/platform/debian/init.d/accumulo-tracer
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/init.d/accumulo-tserver
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/init.d/accumulo-tserver?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/init.d/accumulo-tserver (added)
+++ accumulo/trunk/assemble/platform/debian/init.d/accumulo-tserver Mon Oct 15 19:57:46 2012
@@ -0,0 +1,142 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: accumulo-tserver
+# Required-Start: $network $local_fs hadoop-namenode hadoop-datanode zookeeper-server
+# Required-Stop: $network $local_fs hadoop-datanode hadoop-namenode zookeeper-server
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: accumulo tserver process
+# Description: The accumulo tserver process
+### END INIT INFO
+
+# Author: John Vines <jo...@sqrrl.com>
+
+# 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
+. /lib/init/vars.sh
+
+# 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/platform/debian/init.d/accumulo-tserver
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/master-only-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/master-only-init.sh?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/master-only-init.sh (added)
+++ accumulo/trunk/assemble/platform/debian/master-only-init.sh Mon Oct 15 19:57:46 2012
@@ -0,0 +1,25 @@
+#! /bin/sh
+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-master /etc/init.d/
+update-rc.d accumulo-master start 21 2 3 4 5 . stop 19 0 1 6 .
Propchange: accumulo/trunk/assemble/platform/debian/master-only-init.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: accumulo/trunk/assemble/platform/debian/master-only-init.sh
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/monitor-only-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/monitor-only-init.sh?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/monitor-only-init.sh (added)
+++ accumulo/trunk/assemble/platform/debian/monitor-only-init.sh Mon Oct 15 19:57:46 2012
@@ -0,0 +1,25 @@
+#! /bin/sh
+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_MONITOR_USER=" /etc/default/accumulo >> /dev/null ; then
+ echo "ACCUMULO_MONITOR_USER=accumulo_monitor" >> /etc/default/accumulo
+fi
+
+if ! id -u accumulo_monitor >/dev/null 2>&1; then
+ if ! egrep "^accumulo:" /etc/group > /dev/null; then
+ groupadd accumulo
+ fi
+ useradd -d /usr/lib/accumulo -g accumulo accumulo_monitor
+fi
+
+install -m 0755 -o root -g root init.d/accumulo-monitor /etc/init.d/
+update-rc.d accumulo-monitor defaults
+
Propchange: accumulo/trunk/assemble/platform/debian/monitor-only-init.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: accumulo/trunk/assemble/platform/debian/monitor-only-init.sh
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/stand-alone-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/stand-alone-init.sh?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/stand-alone-init.sh (added)
+++ accumulo/trunk/assemble/platform/debian/stand-alone-init.sh Mon Oct 15 19:57:46 2012
@@ -0,0 +1,11 @@
+#! /bin/sh
+if [ $(id -ur) -ne 0 ]; then
+ echo "This script must be run as root" 1>&2
+ exit 1
+fi
+
+./gc-only-init.sh
+./monitor-only-init.sh
+./tracer-only-init.sh
+./master-only-init.sh
+./tserver-only-init.sh
Propchange: accumulo/trunk/assemble/platform/debian/stand-alone-init.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: accumulo/trunk/assemble/platform/debian/stand-alone-init.sh
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/tracer-only-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/tracer-only-init.sh?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/tracer-only-init.sh (added)
+++ accumulo/trunk/assemble/platform/debian/tracer-only-init.sh Mon Oct 15 19:57:46 2012
@@ -0,0 +1,24 @@
+#! /bin/sh
+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_TRACER_USER=" /etc/default/accumulo >> /dev/null ; then
+ echo "ACCUMULO_TRACER_USER=accumulo_tracer" >> /etc/default/accumulo
+fi
+
+if ! id -u accumulo_tracer >/dev/null 2>&1; then
+ if ! egrep "^accumulo:" /etc/group >> /dev/null; then
+ groupadd accumulo
+ fi
+ useradd -d /usr/lib/accumulo -g accumulo accumulo_tracer
+fi
+
+install -m 0755 -o root -g root init.d/accumulo-tracer /etc/init.d/
+update-rc.d accumulo-tracer defaults
Propchange: accumulo/trunk/assemble/platform/debian/tracer-only-init.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: accumulo/trunk/assemble/platform/debian/tracer-only-init.sh
------------------------------------------------------------------------------
svn:executable = *
Added: accumulo/trunk/assemble/platform/debian/tserver-only-init.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/platform/debian/tserver-only-init.sh?rev=1398485&view=auto
==============================================================================
--- accumulo/trunk/assemble/platform/debian/tserver-only-init.sh (added)
+++ accumulo/trunk/assemble/platform/debian/tserver-only-init.sh Mon Oct 15 19:57:46 2012
@@ -0,0 +1,25 @@
+#! /bin/sh
+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/
+update-rc.d accumulo-tserver start 21 2 3 4 5 . stop 15 0 1 6 .
Propchange: accumulo/trunk/assemble/platform/debian/tserver-only-init.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: accumulo/trunk/assemble/platform/debian/tserver-only-init.sh
------------------------------------------------------------------------------
svn:executable = *