diff --git a/Installation/Linux/rc.arangod.Centos b/Installation/Linux/rc.arangod.Centos index ce07efbf36..4606177316 100644 --- a/Installation/Linux/rc.arangod.Centos +++ b/Installation/Linux/rc.arangod.Centos @@ -1,4 +1,4 @@ -#!/bin/bash +#! /bin/bash # # arangod Startup script for the ArangoDB Server # @@ -48,13 +48,10 @@ stop() { } -action="$1" -shift - # See how we were called. -case "$action" in +case "$1" in start) - start $@ + start ;; stop) @@ -68,11 +65,15 @@ case "$action" in restart) stop - start $@ + start + ;; + + upgrade) + start --upgrade ;; *) - echo $"Usage: $ARANGO_BIN {start|stop|restart|status|help} " + echo $"Usage: $0 {start|stop|restart|status|help|upgrade}" exit 1 esac diff --git a/Installation/Linux/rc.arangod.Debian b/Installation/Linux/rc.arangod.Debian index 43e0e4f7ad..eb527d9e4c 100644 --- a/Installation/Linux/rc.arangod.Debian +++ b/Installation/Linux/rc.arangod.Debian @@ -21,11 +21,7 @@ CONF=/etc/arangodb/arangod.conf test -x $DAEMON || exit 0 -action="$1" -shift - -case "$action" in - start) +start () { log_begin_msg "Starting $DESC" "$NAME" pid=$( pidofproc -p $PIDFILE $DAEMON ) @@ -41,6 +37,11 @@ case "$action" in $DAEMON -c $CONF --pid-file "$PIDFILE" --supervisor --uid arangodb $@ log_end_msg $? +} + +case "$1" in + start) + start ;; stop) @@ -66,8 +67,12 @@ case "$action" in status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? ;; + upgrade) + start --upgrade + ;; + *) - log_success_msg "Usage: /etc/init.d/arango {start|stop|restart|force-reload|status} " + log_success_msg "Usage: /etc/init.d/arango {start|stop|restart|force-reload|status|upgrade}" exit 1 ;; esac diff --git a/Installation/Linux/rc.arangod.OpenSuSE b/Installation/Linux/rc.arangod.OpenSuSE index 06044a91f3..b8860584ed 100644 --- a/Installation/Linux/rc.arangod.OpenSuSE +++ b/Installation/Linux/rc.arangod.OpenSuSE @@ -43,10 +43,19 @@ ARANGO_PIDFILE=/var/run/arangodb/arangod.pid # First reset status of this service rc_reset -action="$1" -shift +start () { + echo -n "Starting ARANGODB daemon" -case "$action" in + ARANGO_PIDDIR=`dirname $ARANGO_PIDFILE` + test -d $ARANGO_PIDDIR || (mkdir $ARANGO_PIDDIR && chown arangodb $ARANGO_PIDDIR) + + startproc $ARANGO_BIN -c $ARANGO_SYSCONFIG --pid-file "$ARANGO_PIDFILE" --supervisor --uid arangodb $@ + + # Remember status and be verbose + rc_status -v +} + +case "$1" in ################################################################################ ## Start daemon with startproc(8). If this fails @@ -54,15 +63,7 @@ case "$action" in ################################################################################ start) - echo -n "Starting ARANGODB daemon" - - ARANGO_PIDDIR=`dirname $ARANGO_PIDFILE` - test -d $ARANGO_PIDDIR || (mkdir $ARANGO_PIDDIR && chown arangodb $ARANGO_PIDDIR) - - $ARANGO_BIN -c $ARANGO_SYSCONFIG --pid-file "$ARANGO_PIDFILE" --supervisor --uid arangodb $@ - - # Remember status and be verbose - rc_status -v + start ;; ################################################################################ @@ -139,26 +140,20 @@ case "$action" in ;; + ################################################################################ + ## upgrade database + ################################################################################ + + upgrade) + start --upgrade + ;; + ################################################################################ ## print usage message ################################################################################ *) - cat >&2 <<-EOF - Usage: $0 - - where is one of: - start - start arangod - stop - stop arangod - try-restart - stop arangod and if this succeeds (i.e. if - it was running before), start it again. - status - check whether arangod is running - restart - stop arangod if running; start service - help - this screen - - optional server options are passed through to arangod. - - EOF + echo "Usage: $0 {start|stop|restart|force-reload|status|upgrade}" exit 1 ;; diff --git a/Installation/Linux/rc.arangod.Ubuntu b/Installation/Linux/rc.arangod.Ubuntu index a2d0604e26..c63ce8972f 100644 --- a/Installation/Linux/rc.arangod.Ubuntu +++ b/Installation/Linux/rc.arangod.Ubuntu @@ -23,11 +23,7 @@ CONF=/etc/arangodb/arangod.conf test -x $DAEMON || exit 0 -action="$1" -shift - -case "$action" in - start) +start () { log_daemon_msg "Starting $DESC" "$NAME" test -d $PIDDIR || mkdir $PIDDIR @@ -35,6 +31,11 @@ case "$action" in $DAEMON -c $CONF --pid-file "$PIDFILE" --supervisor --uid arangodb $@ log_end_msg $? +} + +case "$1" in + start) + start ;; stop) @@ -60,8 +61,12 @@ case "$action" in status_of_proc $DAEMON $NAME && exit 0 || exit $? ;; + upgrade) + start --upgrade + ;; + *) - log_success_msg "Usage: /etc/init.d/arango {start|stop|restart|force-reload|status} " + log_success_msg "Usage: /etc/init.d/arango {start|stop|restart|force-reload|status|upgrade}" exit 1 ;; esac