Start at boot - possible only using root

Created a script in /init.d called “seafile-server” using as a template.

sudo -u seafile ./ -> seafile is started
sudo -u seafile ./ -> seahub is NOT started

after boot, logging in with user seafile & starting works fine!
It is necessary to use sudo (path)/ in order for seahub to start with boot.
Can I leave it at this or is it a concern for security if seahub runs with root ?

Maybe some files with a wrong permission that prevent seahub from start with non-root. Can you check the permissions for the log files seahub need to write to?

hey, thank you for your suggestion -

ls -ltr …/seafile-server-6.0.5/runtime/
-rw-r–r–. 1 seafile seafile 6 Nov 21 19:00 …/seafile-server-6.0.5/runtime/

ls -ltr …/logs/seahub_django_request.log
-rw-r–r–. 1 seafile seafile 104 Nov 20 17:50 …/logs/seahub_django_request.log

ls -ltr …/logs/seahub.log
-rw-r–r–. 1 seafile seafile 0 Nov 20 13:04 …/logs/seahub.log

since starts fine from commandline with user seafile - are there any different permissions needed when is started from user seafile in init.d script ?

Deleted /tmp/seahub_cache & chowned all files to seafile/seafile. - unfortunately the problem still persists.

There are another log file seahub.init.log. Is the permission of this file correct?

yes seahub.init.log:

ls -ltr …/logs/seahub.init.log
-rw-r–r–. 1 seafile seafile 5104 Nov 21 18:57 …/logs/seahub.init.log

cat seahub.init.log

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …
Error:Seahub failed to start.
Please try to run “./ start” again

do you see anything wrong ?

I realise this thread is almost 2 years old but I’m having exactly the same problem with Pro v 6.3.5 (and I had it with 6.2.13 - see Seahub only starts as root (Linux))

There are no permission issues that I can see. I’ve deleted all log files and the directories in /tmp so that and can recreate them.

Using sudo -u seafile … fails but su seafile and then running works

I’ve even tried starting it on a different port without success.

This is driving me insane - I don’t know what else to try.

Are there any debugging commands I can issue? Nothing shows up the seahub*.log files other than “Seahub failed to start” which is not helpful!


I’m experiencing this same issue and none of the answers I’m finding are helpful so far.

I also never got it to start with systemd. Its just not made for it.