'seahub.sh stop' fails (with suggested fix)

When I try to stop or restart seahub (seafile-server-12.0.14), I get this every time:

$ ./seahub.sh stop

Stopping seahub …
Failed to stop seahub.
$ echo $?
1

This is the function in seahub.sh that fails:

function stop_seahub () {
if [[ -f ${pidfile} ]]; then
echo “Stopping seahub …”
pkill -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}
return 0
else
echo “Seahub is not running”
fi
}

Replacing sleep 1 by sleep 2 fixes the problem. A more robust mechanism, e.g. checking every second for a few seconds, would be even better.

Where should I report this? I am not a seafile developer.

Thanks for reporting this issue. Typically, 1 second is enough for the process to stop.
Since Seafile version 13.0, the Docker image has become the primary way to run Seafile, making this specific script issue less relevant for the majority of installations. As a result, we don’t have a plan to modify the script at this time.