seafile 8.0.4采用非docker安装,seatable采用docker安装
问题1、发现对seafile执行seahub.sh stop,关闭服务会导致seatable一并被关闭
问题2:seafile执行seahub.sh stop,再次执行seahub.sh start提示Seahub is already running
问题1是两个服务都用了gunicorn,而seafile关闭服务时脚本过于暴力,导致误杀
问题2是seafile自己的问题,脚本感觉没有跟随服务升级而更新
解决:
编辑seafile安装目录下seahub.sh,启动时按上次pid查询是否还在运行,关闭时按pid查询主进程和子进程然后精准关闭
function validate_seahub_running () {
if pgrep -f “${manage_py}” 2>/dev/null 1>&2; then
echo “Seahub is already running.”
exit 1;
#elif pgrep -f “seahub.wsgi:application” 2>/dev/null 1>&2; then
elif pgrep -F ${pidfile} 2>/dev/null 1>&2; then
echo “Seahub is already running.”
exit 1;
fi
}
function stop_seahub () {
if [[ -f ${pidfile} ]]; then
echo “Stopping seahub …”
#pkill -9 -f “thirdpart/bin/gunicorn”
#sleep 1
#if pgrep -f “thirdpart/bin/gunicorn” 2>/dev/null 1>&2 ; then
# echo ‘Failed to stop seahub.’
# exit 1
#fi
#rm -f ${pidfile}
pid=`cat ${pidfile}`
kill -9 `ps -h --ppid ${pid} -p ${pid} | awk '{print $1}'`
sleep 1
if pgrep -F ${pidfile} 2>/dev/null 1>&2 ; then
echo 'Failed to stop seahub.'
exit 1
fi
return 0
else
echo "Seahub is not running"
fi
}
另外一个共存的问题:解决同域名下seafile与seatable的会话冲突,解决同域名下seafile与seatable的会话冲突