diff --git a/scripts/install_bootstrap.sh b/scripts/install_bootstrap.sh index c1a253857d..e3aee2eaeb 100755 --- a/scripts/install_bootstrap.sh +++ b/scripts/install_bootstrap.sh @@ -62,7 +62,7 @@ sudo chmod 0755 set_nomad_as_server.sh cd /etc/maya.d/templates echo "Fetching mayaserver config templates ..." -curl -sSL https://raw.githubusercontent.com/openebs/maya/master/templates/mayaserver.service.tmpl -o mayaserver.service.tmpl +curl -sSL https://raw.githubusercontent.com/openebs/maya/master/templates/m-apiserver.service.tmpl -o m-apiserver.service.tmpl curl -sSL https://raw.githubusercontent.com/openebs/maya/master/templates/nomad_global.INI.tmpl -o nomad_global.INI.tmpl echo "Fetching consul config templates ..." diff --git a/scripts/install_mayaserver.sh b/scripts/install_mayaserver.sh index 5173c2fbcf..892129bec9 100755 --- a/scripts/install_mayaserver.sh +++ b/scripts/install_mayaserver.sh @@ -2,29 +2,28 @@ set -e -MAYA_VERSION="0.0.6" +MAPI_VERSION="0.2-RC1" CURDIR=`pwd` -#if [[ $(which mayaserver >/dev/null && mayaserver version | head -n 1 | cut -d ' ' -f 2 | sed 's/dev//' | cut -d "'" -f 2) == "$MAYA_VERSION" ]]; then -#echo "Mayaserver v$MAYA_VERSION already installed; Skipping" +#if [[ $(which m-apiserver >/dev/null && m-apiserver version | head -n 1 | cut -d ' ' -f 2 | sed 's/dev//' | cut -d "'" -f 2) == "$MAYA_VERSION" ]]; then +#echo "Maya-API Server v$MAYA_VERSION already installed; Skipping" # exit #fi cd /tmp/ -if [ ! -f "./mayaserver_${MAYA_VERSION}.zip" ]; then -echo "Fetching Mayaserver ${MAYA_VERSION} ..." -curl -sSL https://github.com/openebs/mayaserver/releases/download/${MAYA_VERSION}/mayaserver-linux_amd64.zip -o mayaserver_$MAYA_VERSION.zip +if [ ! -f "./m-apiserver_${MAPI_VERSION}.zip" ]; then +echo "Fetching Maya-API Server ${MAPI_VERSION} ..." +curl -sSL https://github.com/openebs/mayaserver/releases/download/${MAPI_VERSION}/m-apiserver-linux_amd64.zip -o m-apiserver_$MAPI_VERSION.zip fi -echo "Installing Mayaserver ${MAYA_VERSION} ..." -unzip mayaserver_$MAYA_VERSION.zip -sudo chmod +x mayaserver -sudo mv mayaserver /usr/bin/mayaserver +echo "Installing Maya-API Server ${MAPI_VERSION} ..." +unzip m-apiserver_$MAPI_VERSION.zip +sudo chmod +x m-apiserver +sudo mv m-apiserver /usr/bin/ -# Setup config directory for mayaserver +# Setup INI config directory for m-apiserver sudo mkdir -p /etc/mayaserver/orchprovider sudo chmod a+w /etc/mayaserver/orchprovider - cd ${CURDIR} diff --git a/scripts/start_mayaserver.sh b/scripts/start_mayaserver.sh index eebf8f10e8..aa5e4d99f1 100644 --- a/scripts/start_mayaserver.sh +++ b/scripts/start_mayaserver.sh @@ -5,21 +5,21 @@ set -e SELF_IPV4=$1 if [ $# -eq 0 ]; then - +# if no listen ip provided then start as localhost SELF_IP4=127.0.0.1 fi -echo "Setting up Mayaserver Daemon ...with ip $SELF_IPV4" +echo "Setting up m-apiserver Daemon ...with ip $SELF_IPV4" # Place systemd service template for Mayaserver -sudo cp /etc/maya.d/templates/mayaserver.service.tmpl /etc/systemd/system/mayaserver.service +sudo cp /etc/maya.d/templates/m-apiserver.service.tmpl /etc/systemd/system/m-apiserver.service sudo cp /etc/maya.d/templates/nomad_global.INI.tmpl /etc/mayaserver/orchprovider/nomad_global.INI # Replace the placeholders with actual values -sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/systemd/system/mayaserver.service +sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/systemd/system/m-apiserver.service sudo sed -e "s|__SELF_IPV4__|$SELF_IPV4|g" -i /etc/mayaserver/orchprovider/nomad_global.INI -echo "Starting Mayaserver service ..." +echo "Starting m-apiserver service ..." -sudo systemctl enable mayaserver.service -sudo systemctl restart mayaserver.service +sudo systemctl enable m-apiserver.service +sudo systemctl restart m-apiserver.service diff --git a/templates/mayaserver.service.tmpl b/templates/m-apiserver.service.tmpl similarity index 59% rename from templates/mayaserver.service.tmpl rename to templates/m-apiserver.service.tmpl index 56ae025a60..077f1543c1 100644 --- a/templates/mayaserver.service.tmpl +++ b/templates/m-apiserver.service.tmpl @@ -1,10 +1,10 @@ [Unit] -Description=Mayaserver Daemon +Description=m-apiserver Daemon [Service] Environment=GOMAXPROCS=2 Restart=on-failure -ExecStart=/usr/bin/mayaserver up -bind=__SELF_IPV4__ &>mserver.log +ExecStart=/usr/bin/m-apiserver up -bind=__SELF_IPV4__ &>mapiserver.log ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGTERM