Bump version to 0.3.5next
[archipelago] / xseg / launch
index a95ee81..e85281d 100755 (executable)
@@ -1,6 +1,39 @@
 #!/bin/bash
+
+# Copyright 2012 GRNET S.A. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+#
+#   1. Redistributions of source code must retain the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer.
+#
+#   2. Redistributions in binary form must reproduce the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer in the documentation and/or other materials
+#      provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
 #
-# Launcher for xseg configurations
+# The views and conclusions contained in the software and
+# documentation are those of the authors and should not be
+# interpreted as representing official policies, either expressed
+# or implied, of GRNET S.A.
+#
+
 
 NI_SAVED=${NONINTERACTIVE}
 export NONINTERACTIVE=1
@@ -33,7 +66,7 @@ function parse_config {
        [ -z "${MAPS}" ] && MAPS="/home/user/archip/xseg/peers/user/foo"
        [ -z "${PITHOS}" ] && PITHOS="/srv/pithos/data/blocks"
        [ -z "${PITHOSMAPS}" ] && PITHOSMAPS="/srv/pithos/data/maps"
-       [ -z "${XSEG_LOGS}" ] && XSEG_LOGS="/home/philipgian/archip/logs"
+       [ -z "${XSEG_LOGS}" ] && XSEG_LOGS="/srv/archip/logs"
        [ -z "${DEVICE_PREFIX}" ] && DEVICE_PREFIX="/dev/xsegbd"
        [ -z "${XSEGBD_SYSFS}" ] && XSEGBD_SYSFS="/sys/bus/xsegbd"
        [ -z "${CHRDEV_NAME}" ] && CHRDEV_NAME="/dev/`cat /proc/devices | grep segdev | awk '{print $2}'`"
@@ -118,12 +151,12 @@ function spawn_pfiledm {
 
 function spawn_sosd {
        "${XSEG_HOME}/peers/user/mt-sosd" -p "$BPORT" -g "${SPEC}" -n \
-       ${NR_OPS} --pool "blocks" -v 1 &> "${XSEG_LOGS}/sosd-${HOSTNAME}" &
+       ${NR_OPS} --pool "blocks" -v 3 &> "${XSEG_LOGS}/sosd-${HOSTNAME}" &
 }
 
 function spawn_sosdm {
        "${XSEG_HOME}/peers/user/mt-sosd" -p "$MBPORT" -g "${SPEC}" -n \
-       ${NR_OPS} --pool "maps" -v 1  &> "${XSEG_LOGS}/sosdm-${HOSTNAME}" &
+       ${NR_OPS} --pool "maps" -v 3  &> "${XSEG_LOGS}/sosdm-${HOSTNAME}" &
 }
 
 function spawn_vlmcd {
@@ -135,6 +168,8 @@ function spawn_vlmcd {
 }
 
 function spawn_mapperdc {
+       echo "\"${XSEG_HOME}/peers/user/mt-mapperd\" -t 1 -sp \"$MPORT\" -ep
+       \"$MPORT\" -bp \"$BPORT\" -mbp \"$MBPORT\" -g \"${SPEC}\" -n ${NR_OPS} -v 3" 
        pgrep -f "mt-mapperd" || \
        "${XSEG_HOME}/peers/user/mt-mapperd" -t 1 -sp "$MPORT" -ep "$MPORT"\
        -bp "$BPORT" -mbp "$MBPORT" -g "${SPEC}"\
@@ -354,6 +389,19 @@ doublesosd)
                ;;
        esac
        ;;
+mtmapperd)
+       case $2 in
+       start)
+               spawn_mapperdc
+               ;;
+       stop)
+               pkill -f peers/user/mt-mapperd || true
+               ;;
+       *)
+               help
+               ;;
+       esac
+       ;;
 *)
        help
        ;;