Solved - Ubuntu 18.04 + Seafile server - not starting on system boot


I recently put together a new Ubuntu 18.04 PC using an UDOO x86 Ultra (Intel 64bit) and although the installation all went perfect and everything seemed to set up correctly Seafile server will not start on system boot.

According to the system.d output both seafile and seahub fail to start.

So I thought I’d use a cron job instead, that also fails to start the server on startup - but if I then run the cron manually both components start up and continue working.

Does any one have any thoughts on what could be wrong? I followed the installation instructions and I never had this issue with my previous Ubuntu 16 SBC.

Yes… Make certain that you are using the direct path in systemd. Systemd doesn’t like symlinks and “seafile-server-latest” is a symlink. I ran into this same problem with my Debian install, and it lets you know that when you reboot/start the machine itself… Let’s you know on the console screen. But, since I keep older versions of Seafile on my server, I didn’t want to have to update the direct path in systemd every time a new version came out, so I use init.d instead. Works fine.

Check your systemd config and make certain it’s a direct path, not a symlink.

I updated my systemd configs for the services and changed them from the …-latest to …-6.2.5 folder paths but they are still failing.

I also updated the cron jobs I was trying to use as well and they fail to start but can be successfully run manually.

Any other options?

Please post your startup scripts for seafile and seahub.

I’m not a big fan of systemd. I prefer init.d, and it works fine with Seafile. The instructions on how to use init.d to start Seafile on startup are in the manual, and fairly easy to follow.

Finally worked it out.

After looking through the journalctl -xe log I realised that seafood was trying to connect to the database using localhost despite the config files using the ip address for localhost

So, I changed the mysql user permissions from localhost to and the config files and it finally worked on system start up.

1 Like

Initd is not available in Ubuntu 18.04.

Interesting… I haven’t fooled around with 18.04 yet. So, they deprecated it? It was available in prior versions. I use Debian these days.

Apparently it was removed but installable in 17.04, but removed and blocked in 18.

I did a little research earlier. Yup… It’s deprecated, but there are instructions on how to bring it back in version 18. :slight_smile:

I had the same Problem, i solved it like that:

# add mysql.service or postgresql.service depending on your database to the line below httpd.service

ExecStart=/var/seafile/haiwen/seafile-server-latest/ start
ExecStop=/var/seafile/haiwen/seafile-server-latest/ stop



Description=Seafile hub seafile.service

ExecStart=/var/seafile/haiwen/seafile-server-latest/ start
ExecStop=/var/seafile/haiwen/seafile-server-latest/ stop


If I remember correctly localhost has a special meaning in MySQL and only applies to socket connections - not ip connections.

I also added in some extra ‘After’ services to ensure seafile wasn’t started before mySQL, but that didn’t help. It was only after changing all the localhosts to that finally fixed the problem for me.

@shoeper I think you’re correct localhost and are different in mySQL, despite being the same thing at a network level.

Seafile should be started after the database, as it is in need of, but I didn’t have to configure it explicitly.

My problem with Ubuntu 18.04 + Seafile server was the deprecation of the Python package python-imaging, resulting in the seahub service not starting on boot.

journalctl -xe was outputting:

ImportError: No module named Image

… pointing towards a missing python module Image.

The module python-imaging has been deprecated, but got this working by installing python-pil, as this package is a fork of python-imaging:

sudo apt-get install python-pil

Hope this may help somebody! :slight_smile:


Glad you got it working. But, it’s strange that you were able to start Seafile manually. I wasn’t aware that there was an additional dependency for starting Seafile at boot.

Great, thx. How did you find out? I had nothing in the logs pointing that direction…