1
0
Fork 0

added command "upgrade" to init scripts

This commit is contained in:
a-brandt 2013-02-12 10:23:13 +01:00
parent 538bb68a1d
commit 40badb78bd
4 changed files with 53 additions and 47 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #! /bin/bash
# #
# arangod Startup script for the ArangoDB Server # arangod Startup script for the ArangoDB Server
# #
@ -48,13 +48,10 @@ stop() {
} }
action="$1"
shift
# See how we were called. # See how we were called.
case "$action" in case "$1" in
start) start)
start $@ start
;; ;;
stop) stop)
@ -68,11 +65,15 @@ case "$action" in
restart) restart)
stop stop
start $@ start
;;
upgrade)
start --upgrade
;; ;;
*) *)
echo $"Usage: $ARANGO_BIN {start|stop|restart|status|help} <server options>" echo $"Usage: $0 {start|stop|restart|status|help|upgrade}"
exit 1 exit 1
esac esac

View File

@ -21,11 +21,7 @@ CONF=/etc/arangodb/arangod.conf
test -x $DAEMON || exit 0 test -x $DAEMON || exit 0
action="$1" start () {
shift
case "$action" in
start)
log_begin_msg "Starting $DESC" "$NAME" log_begin_msg "Starting $DESC" "$NAME"
pid=$( pidofproc -p $PIDFILE $DAEMON ) pid=$( pidofproc -p $PIDFILE $DAEMON )
@ -41,6 +37,11 @@ case "$action" in
$DAEMON -c $CONF --pid-file "$PIDFILE" --supervisor --uid arangodb $@ $DAEMON -c $CONF --pid-file "$PIDFILE" --supervisor --uid arangodb $@
log_end_msg $? log_end_msg $?
}
case "$1" in
start)
start
;; ;;
stop) stop)
@ -66,8 +67,12 @@ case "$action" in
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? 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} <server options>" log_success_msg "Usage: /etc/init.d/arango {start|stop|restart|force-reload|status|upgrade}"
exit 1 exit 1
;; ;;
esac esac

View File

@ -43,10 +43,19 @@ ARANGO_PIDFILE=/var/run/arangodb/arangod.pid
# First reset status of this service # First reset status of this service
rc_reset rc_reset
action="$1" start () {
shift 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 ## Start daemon with startproc(8). If this fails
@ -54,15 +63,7 @@ case "$action" in
################################################################################ ################################################################################
start) start)
echo -n "Starting ARANGODB daemon" start
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
;; ;;
################################################################################ ################################################################################
@ -139,26 +140,20 @@ case "$action" in
;; ;;
################################################################################
## upgrade database
################################################################################
upgrade)
start --upgrade
;;
################################################################################ ################################################################################
## print usage message ## print usage message
################################################################################ ################################################################################
*) *)
cat >&2 <<-EOF echo "Usage: $0 {start|stop|restart|force-reload|status|upgrade}"
Usage: $0 <command> <server options>
where <command> 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
exit 1 exit 1
;; ;;

View File

@ -23,11 +23,7 @@ CONF=/etc/arangodb/arangod.conf
test -x $DAEMON || exit 0 test -x $DAEMON || exit 0
action="$1" start () {
shift
case "$action" in
start)
log_daemon_msg "Starting $DESC" "$NAME" log_daemon_msg "Starting $DESC" "$NAME"
test -d $PIDDIR || mkdir $PIDDIR test -d $PIDDIR || mkdir $PIDDIR
@ -35,6 +31,11 @@ case "$action" in
$DAEMON -c $CONF --pid-file "$PIDFILE" --supervisor --uid arangodb $@ $DAEMON -c $CONF --pid-file "$PIDFILE" --supervisor --uid arangodb $@
log_end_msg $? log_end_msg $?
}
case "$1" in
start)
start
;; ;;
stop) stop)
@ -60,8 +61,12 @@ case "$action" in
status_of_proc $DAEMON $NAME && exit 0 || exit $? 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} <server options>" log_success_msg "Usage: /etc/init.d/arango {start|stop|restart|force-reload|status|upgrade}"
exit 1 exit 1
;; ;;
esac esac