fix a bug when changing FS_PREFIX

This commit is contained in:
Gallen 2019-03-18 09:43:44 +08:00
parent c908f0a95e
commit d790ab9b9c
4 changed files with 19 additions and 15 deletions

View File

@ -18,9 +18,6 @@ DOCKLET_USER=$DOCKLET_HOME/user
# default working directory, default to /opt/docklet # default working directory, default to /opt/docklet
FS_PREFIX=/opt/docklet FS_PREFIX=/opt/docklet
RUN_DIR=$FS_PREFIX/local/run
LOG_DIR=$FS_PREFIX/local/log
#network interface , default is eth0 #network interface , default is eth0
NETWORK_DEVICE=eth0 NETWORK_DEVICE=eth0
#etcd server address, default is localhost:2379 #etcd server address, default is localhost:2379
@ -44,6 +41,9 @@ DISTRIBUTED_GATEWAY=False
export FS_PREFIX export FS_PREFIX
RUN_DIR=$FS_PREFIX/local/run
LOG_DIR=$FS_PREFIX/local/log
# This next line determines what user the script runs as. # This next line determines what user the script runs as.
DAEMON_USER=root DAEMON_USER=root

View File

@ -18,9 +18,6 @@ DOCKLET_USER=$DOCKLET_HOME/user
# default working directory, default to /opt/docklet # default working directory, default to /opt/docklet
FS_PREFIX=/opt/docklet FS_PREFIX=/opt/docklet
RUN_DIR=$FS_PREFIX/local/run
LOG_DIR=$FS_PREFIX/local/log
#configurable-http-proxy public port, default is 8000 #configurable-http-proxy public port, default is 8000
PROXY_PORT=8000 PROXY_PORT=8000
#configurable-http-proxy api port, default is 8001 #configurable-http-proxy api port, default is 8001
@ -43,6 +40,9 @@ BATCH_NET="10.16.0.0/16"
export FS_PREFIX export FS_PREFIX
RUN_DIR=$FS_PREFIX/local/run
LOG_DIR=$FS_PREFIX/local/log
# This next line determines what user the script runs as. # This next line determines what user the script runs as.
DAEMON_USER=root DAEMON_USER=root

View File

@ -28,13 +28,13 @@ PROXY_PORT=8000
PROXY_API_PORT=8001 PROXY_API_PORT=8001
DISTRIBUTED_GATEWAY=False DISTRIBUTED_GATEWAY=False
RUN_DIR=$FS_PREFIX/local/run
LOG_DIR=$FS_PREFIX/local/log
. $DOCKLET_CONF/docklet.conf . $DOCKLET_CONF/docklet.conf
export FS_PREFIX export FS_PREFIX
RUN_DIR=$FS_PREFIX/local/run
LOG_DIR=$FS_PREFIX/local/log
# This next line determines what user the script runs as. # This next line determines what user the script runs as.
DAEMON_USER=root DAEMON_USER=root

View File

@ -54,15 +54,19 @@ echo ""
[[ -f conf/docklet.conf ]] || { echo "Generating docklet.conf from template" && cp conf/docklet.conf.template conf/docklet.conf; } [[ -f conf/docklet.conf ]] || { echo "Generating docklet.conf from template" && cp conf/docklet.conf.template conf/docklet.conf; }
[[ -f web/templates/home.html ]] || { echo "Generating HomePage from home.template" && cp web/templates/home.template web/templates/home.html; } [[ -f web/templates/home.html ]] || { echo "Generating HomePage from home.template" && cp web/templates/home.template web/templates/home.html; }
mkdir -p /opt/docklet/global FS_PREFIX=/opt/docklet
mkdir -p /opt/docklet/local/ . conf/docklet.conf
export FS_PREFIX
echo "directory /opt/docklet have been created" mkdir -p $FS_PREFIX/global
mkdir -p $FS_PREFIX/local/
if [[ ! -d /opt/docklet/local/basefs && ! $1 = "withoutfs" ]]; then echo "directory FS_PREFIX (${FS_PREFIX}) have been created"
mkdir -p /opt/docklet/local/basefs
if [[ ! -d $FS_PREFIX/local/basefs && ! $1 = "withoutfs" ]]; then
mkdir -p $FS_PREFIX/local/basefs
echo "Generating basefs" echo "Generating basefs"
wget -P /opt/docklet/local http://iwork.pku.edu.cn:1616/basefs-0.11.tar.bz2 && tar xvf /opt/docklet/local/basefs-0.11.tar.bz2 -C /opt/docklet/local/ > /dev/null wget -P $FS_PREFIX/local http://iwork.pku.edu.cn:1616/basefs-0.11.tar.bz2 && tar xvf $FS_PREFIX/local/basefs-0.11.tar.bz2 -C $FS_PREFIX/local/ > /dev/null
[ $? != "0" ] && echo "Generate basefs failed, please download it from http://unias.github.io/docklet/download to FS_PREFIX/local and then extract it using root. (defalut FS_PRERIX is /opt/docklet)" [ $? != "0" ] && echo "Generate basefs failed, please download it from http://unias.github.io/docklet/download to FS_PREFIX/local and then extract it using root. (defalut FS_PRERIX is /opt/docklet)"
fi fi