#! /bin/sh

#container's options
export GCORE_START_OPTIONS="$GCORE_START_OPTIONS -Xms1024M -Xmx1024M -Djava.io.tmpdir=$GLOBUS_LOCATION/tmp  -Djava.security.egd=file:///dev/urandom -Djava.protocol.handler.pkgs=org.gcube.contentmanagement.storagelayer.storagemanagementservice.stubs.protocol"

[ -e "$GLOBUS_LOCATION/tmp" ] ||  mkdir -p $GLOBUS_LOCATION/tmp

#clean up the services' state if needed
[ -f "$GLOBUS_LOCATION/config/GHNProfile.xml" ] ||  rm -rf ~/.gcore

cd $GLOBUS_LOCATION
echo "gCore is running and logging into logs/container.log..."
$GLOBUS_LOCATION/bin/gcore-start-secure-container-daemon "$@" &
 

