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’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.
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 127.0.0.1.
So, I changed the mysql user permissions from localhost to 127.0.0.1 and the config files and it finally worked on system start up.
I had the same Problem, i solved it like that:
/etc/systemd/system/seafile.service
[Unit]
Description=Seafile
# add mysql.service or postgresql.service depending on your database to the line below
After=network.target httpd.service
[Service]
Type=forking
ExecStart=/var/seafile/haiwen/seafile-server-latest/seafile.sh start
ExecStop=/var/seafile/haiwen/seafile-server-latest/seafile.sh stop
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
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 127.0.0.1 that finally fixed the problem for me.
@shoeper I think you’re correct localhost and 127.0.0.1 are different in mySQL, despite being the same thing at a network level.
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:
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.