stop : I believe there is a bug in this script

In trying Seafile CE 7.1.3 for the first time, i found that ./ stop was not stopping the Gunicorn master and child processes. It thinks it has, and therefore deletes the PID and which then results in processes that can only be killed with KILL or otherwise ./ won’t be able to start the process again.
In particular, I refer to LINES 236 and 238, pkill -9 -f “thirdpart/bin/gunicorn”
What is thirdpart?

Changing the line to pkill -9 -f “gunicorn”
allows ./ stop to work as intended

that would kill ALL Gunicorn processes on the host even if they are not part of this particular instance of Seafile.

The PID is know, why doesn’t ./ stop just do
kill -9 ${pidfile}

Being a beginner with Seafile, I’m sure someone will enlighten me.

OK, I see a bit more…
Gunicorn is included in Seafile, at
(Initially I must have miss-typed when going looking for it.)

But I have gunicorn and python-gunicorn (and 3s as well) installed on this machine!
So, thirdpart/bin/gunicorn wasnt being found, and /usr/bin/gunicorn found instead.

But I still don’t know why
kill -9 ${pidfile}
isn’t good enough

My solution …

function stop_seahub () {
    if [[ -f ${pidfile} ]]; then
        echo "Stopping seahub ..."
        #pkill -9 -f "gunicorn"
        PID=$( pgrep -F $pidfile )
        kill -9 $PID
        sleep 5
        #if pgrep -f "gunicorn" 2>/dev/null 1>&2 ; then
        if [[ $( pgrep -P $PID ) ]]; then
            echo 'Failed to stop seahub.'
            exit 1
        rm -f ${pidfile}
        return 0
        echo "Seahub is not running"

But systemd services know how to stop things they start, so I don’t use it now