mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-18 08:15:14 +00:00
default_seafile_data_dir
This commit is contained in:
@@ -5,6 +5,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
central_config_dir=${TOPDIR}/conf
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
|
||||
function check_python_executable() {
|
||||
if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
|
||||
@@ -31,15 +32,9 @@ function check_python_executable() {
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
function validate_seafile_data_dir () {
|
||||
if [[ ! -d ${default_seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${default_seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
@@ -47,10 +42,10 @@ function read_seafile_data_dir () {
|
||||
}
|
||||
|
||||
check_python_executable;
|
||||
read_seafile_data_dir;
|
||||
validate_seafile_data_dir;
|
||||
|
||||
export CCNET_CONF_DIR=${default_ccnet_conf_dir}
|
||||
export SEAFILE_CONF_DIR=${seafile_data_dir}
|
||||
export SEAFILE_CONF_DIR=${default_seafile_data_dir}
|
||||
export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
|
||||
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.6/site-packages:${INSTALLPATH}/seafile/lib64/python3.6/site-packages:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
|
||||
|
||||
|
@@ -8,6 +8,7 @@ TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
default_conf_dir=${TOPDIR}/conf
|
||||
seaf_fsck=${INSTALLPATH}/seafile/bin/seaf-fsck
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
|
||||
@@ -28,15 +29,9 @@ function validate_ccnet_conf_dir () {
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
function validate_seafile_data_dir () {
|
||||
if [[ ! -d ${default_seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${default_seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
@@ -45,13 +40,13 @@ function read_seafile_data_dir () {
|
||||
|
||||
function run_seaf_fsck () {
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
validate_seafile_data_dir;
|
||||
|
||||
echo "Starting seaf-fsck, please wait ..."
|
||||
echo
|
||||
|
||||
LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_fsck} \
|
||||
-c "${default_ccnet_conf_dir}" -d "${seafile_data_dir}" \
|
||||
-c "${default_ccnet_conf_dir}" -d "${default_seafile_data_dir}" \
|
||||
-F "${default_conf_dir}" \
|
||||
${seaf_fsck_opts}
|
||||
|
||||
|
@@ -8,6 +8,7 @@ TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
default_conf_dir=${TOPDIR}/conf
|
||||
seaf_fuse=${INSTALLPATH}/seafile/bin/seaf-fuse
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
|
||||
@@ -44,15 +45,9 @@ function validate_ccnet_conf_dir () {
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
function validate_seafile_data_dir () {
|
||||
if [[ ! -d ${default_seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${default_seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
@@ -79,7 +74,7 @@ function start_seaf_fuse () {
|
||||
validate_already_running;
|
||||
warning_if_seafile_not_running;
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
validate_seafile_data_dir;
|
||||
|
||||
echo "Starting seaf-fuse, please wait ..."
|
||||
|
||||
@@ -87,7 +82,7 @@ function start_seaf_fuse () {
|
||||
|
||||
LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_fuse} \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
-d "${seafile_data_dir}" \
|
||||
-d "${default_seafile_data_dir}" \
|
||||
-F "${default_conf_dir}" \
|
||||
-l "${logfile}" \
|
||||
"$@"
|
||||
|
@@ -9,6 +9,7 @@ default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
default_conf_dir=${TOPDIR}/conf
|
||||
seaf_gc=${INSTALLPATH}/seafile/bin/seafserv-gc
|
||||
seaf_gc_opts=""
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
|
||||
@@ -30,15 +31,9 @@ function validate_ccnet_conf_dir () {
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
function validate_seafile_data_dir () {
|
||||
if [[ ! -d ${default_seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${default_seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
@@ -75,13 +70,13 @@ function validate_already_running () {
|
||||
function run_seaf_gc () {
|
||||
validate_already_running;
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
validate_seafile_data_dir;
|
||||
|
||||
echo "Starting seafserv-gc, please wait ..."
|
||||
|
||||
LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_gc} \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
-d "${seafile_data_dir}" \
|
||||
-d "${default_seafile_data_dir}" \
|
||||
-F "${default_conf_dir}" \
|
||||
${seaf_gc_opts}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
central_config_dir=${TOPDIR}/conf
|
||||
seaf_controller="${INSTALLPATH}/seafile/bin/seafile-controller"
|
||||
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
export ORIG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
||||
@@ -38,7 +38,7 @@ if [[ $# != 1 || ( "$1" != "start" && "$1" != "stop" && "$1" != "restart" ) ]];
|
||||
fi
|
||||
|
||||
function validate_running_user () {
|
||||
real_data_dir=`readlink -f ${seafile_data_dir}`
|
||||
real_data_dir=`readlink -f ${default_seafile_data_dir}`
|
||||
running_user=`id -un`
|
||||
data_dir_owner=`stat -c %U ${real_data_dir}`
|
||||
|
||||
@@ -66,15 +66,9 @@ function validate_central_conf_dir () {
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
function validate_seafile_data_dir () {
|
||||
if [[ ! -d ${default_seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${default_seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
@@ -84,7 +78,7 @@ function read_seafile_data_dir () {
|
||||
function test_config() {
|
||||
if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} --test \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
-d "${seafile_data_dir}" \
|
||||
-d "${default_seafile_data_dir}" \
|
||||
-F "${central_config_dir}" ; then
|
||||
exit 1;
|
||||
fi
|
||||
@@ -121,7 +115,7 @@ function start_seafile_server () {
|
||||
validate_already_running;
|
||||
validate_central_conf_dir;
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
validate_seafile_data_dir;
|
||||
validate_running_user;
|
||||
test_config;
|
||||
|
||||
@@ -130,7 +124,7 @@ function start_seafile_server () {
|
||||
mkdir -p $TOPDIR/logs
|
||||
LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
-d "${seafile_data_dir}" \
|
||||
-d "${default_seafile_data_dir}" \
|
||||
-F "${central_config_dir}"
|
||||
|
||||
sleep 3
|
||||
|
@@ -17,6 +17,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
central_config_dir=${TOPDIR}/conf
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
|
||||
manage_py=${INSTALLPATH}/seahub/manage.py
|
||||
gunicorn_conf=${TOPDIR}/conf/gunicorn.conf
|
||||
@@ -80,15 +81,9 @@ function validate_ccnet_conf_dir () {
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
function validate_seafile_data_dir () {
|
||||
if [[ ! -d ${default_seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${default_seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
@@ -203,7 +198,7 @@ function start_seahub_fastcgi () {
|
||||
function prepare_env() {
|
||||
check_python_executable;
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
validate_seafile_data_dir;
|
||||
|
||||
if [[ -z "$LANG" ]]; then
|
||||
echo "LANG is not set in ENV, set to en_US.UTF-8"
|
||||
@@ -215,7 +210,7 @@ function prepare_env() {
|
||||
fi
|
||||
|
||||
export CCNET_CONF_DIR=${default_ccnet_conf_dir}
|
||||
export SEAFILE_CONF_DIR=${seafile_data_dir}
|
||||
export SEAFILE_CONF_DIR=${default_seafile_data_dir}
|
||||
export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
|
||||
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.6/site-packages:${INSTALLPATH}/seafile/lib64/python3.6/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
|
||||
|
||||
|
Reference in New Issue
Block a user