How to solve the systemctl start seahub error?

Warning: seahub.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
Job for seahub.service failed because the control process exited with error code. See “systemctl status seahub.service” and “journalctl -xe” for details.

I get the problem when it will start systemctl start seahub, is there a solution ??

Would you provide your system ctl script?

Hi everyone !

I got this issue too. If someone can help, here is my ctl script:

[Unit]
Description=Seafile hub
After=network.target seafile.service

[Service]
ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start-fastcgi
ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop
User=bastien
Group=bastien
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

I should add the status error:

● seahub.service - Seafile hub
Loaded: loaded (/etc/systemd/system/seahub.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since ven. 2016-11-04 13:10:44 CET; 13s ago
Process: 2369 ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start-fastcgi (code=exited, status=1/FAILURE)
Main PID: 2369 (code=exited, status=1/FAILURE)

I solved this changing User and Group to respectively root and sudo.

Anyway, if I can start seafile and seahub with

sudo systemctl start seafile.service

&

sudo systemctl start seafhub.service

I’m not able to have them started automatically at startup.

Can you please provide the startup script for both seafile and seahub.

Note: the “description” has to correlate.

So if the seafile script description is Seafile, then the seahub script must point to Seafile.service (notice the capital first letter) in the network target line for the seahub script, it must match.
My Seafile Script:

[Unit]
Description=Seafile

# add mysql.service or postgresql.service depending on your database to the line below
After=network.target mysql.service

[Service]
Type=oneshot
ExecStart=/home/robbie/seafile/seafile-server-latest/seafile.sh start
ExecStop=/home/robbie/seafile/seafile-server-latest/seafile.sh stop
RemainAfterExit=yes
User=robbie
Group=robbie

[Install]
WantedBy=multi-user.target

My Seahub Script:

[Unit]
Description=Seahub
After=network.target Seafile.service

[Service]
# change start to start-fastcgi if you want to run fastcgi
ExecStart=/home/robbie/seafile/seafile-server-latest/seahub.sh start-fastcgi
ExecStop=/home/robbie/seafile/seafile-server-latest/seahub.sh stop
User=robbie
Group=robbie
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Also the manual doesn’t mention this but:
To enable the seafile.service and seahub.service on boot you must enter the command:

sudo systemctl enable Seafile

&

sudo systemctl enable Seahub

Notice the capital letters correspond again for the names.

2 Likes

I met simillar issue on ubuntu 16.04 lts platform, systemctl can start seafile service but seahub. I can manually start seahub by using

./seahub.sh start

I tried the above solution, it doesn’t work and there is no content in seahub.log, the file size is 0. I can’t find any clue what happened and what’s the difference between systemd start and manual start.

Please take a look at this issue.

Im stuck in the same problem, Here I installed on a Debian 8.7. the seafile and seahub starts great manually, but with the boot script it only starts seafile, the seahub status return "Seahub is already running", but he doesnt.

In my configuration I needed to configure the systemd scripts too

I ran into this issue when I moved my seafile-data folder to a nfs share. The files in seafile-data had the correct permission but the mount point of /opt/seafile/seafile-data itself had the wrong user/group. chown seafile.seafile /opt/seafile/seafile-data fixed the issue.

1 Like

Change my fastcgi to false and it Worked, both seafile and seahub are starting automaticaly

My script below

#!/bin/bash

BEGIN INIT INFO

Provides: seafile-server

#Required-Start: $remote_fs $syslog mysql

Required-Stop: $remote_fs $syslog

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: Seafile server

Description: Start Seafile server

END INIT INFO

Change the value of “user” to your linux user name

user=root

Change the value of “seafile_dir” to your path of seafile installation

usually the home directory of $user

seafile_dir=/home/cmc/seafile
script_path=${seafile_dir}/seafile-server-latest
seafile_init_log=${seafile_dir}/logs/seafile.init.log
seahub_init_log=${seafile_dir}/logs/seahub.init.log

Change the value of fastcgi to false if fastcgi is not used

fastcgi=false

Set the port of fastcgi, default is 8000. Change it if you need different.

fastcgi_port=8000

Write a polite log message with date and time

echo -e "\n \n About to perform $1 for seafile at date -Iseconds \n " >> ${seafile_init_log}
echo -e "\n \n About to perform $1 for seahub at date -Iseconds \n " >> ${seahub_init_log}
case “$1” in
start)
sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
if [ $fastcgi = true ];
then
sudo -u ${user} ${script_path}/seahub.sh ${1}-fastcgi ${fastcgi_port} >> ${seahub_init_log}
else
sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
fi
;;
restart)
sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
if [ $fastcgi = true ];
then
sudo -u ${user} ${script_path}/seahub.sh ${1}-fastcgi ${fastcgi_port} >> ${seahub_init_log}
else
sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
fi
;;
stop)
sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
;;
*)
echo “Usage: /etc/init.d/seafile-server {start|stop|restart}”
exit 1
;;
esac

it has fixed my problem like in this post, thanks indeed!