haiwen / seafile-docker

A Docker image for Seafile server
Other
537 stars 181 forks source link

Weekly cronjob /scripts/fsck.sh Kills Container #270

Closed metti-himself closed 2 years ago

metti-himself commented 2 years ago

Hello,

I think there might be a problem with the watch_controller(): in /scripts/start.py, if we run a fsck that seems to run a bit too long.

def watch_controller():
    maxretry = 4
    retry = 0
    while retry < maxretry:
        controller_pid = get_command_output('ps aux | grep seafile-controller | grep -v grep || true').strip()
        garbage_collector_pid = get_command_output('ps aux | grep /scripts/gc.sh | grep -v grep || true').strip()
        if not controller_pid and not garbage_collector_pid:
            retry += 1
        else:
            retry = 0
        time.sleep(5)
    print('seafile controller exited unexpectedly.')
    sys.exit(1)

I tried to add an additional check with fsck.sh but got no luck


fsck_pid = get_command_output('ps aux | grep /scripts/fsck.sh | grep -v grep || true').strip()
        if not controller_pid and not garbage_collector_pid and not fsck_pid:

After a few seconds I only see seafile controller exited and the container dies. Can anybody give me an hint how to fix this?

Regards

Matthias

freeplant commented 2 years ago

When you run fsck, you don't need to story Seafile server (the controller). So you don't need to modify watch_controller().

metti-himself commented 2 years ago

Ok thanks for the response @freeplant, should have looked it up in the manual.