Seafile don't start after reboot


#1

I followed this guide https://manual.seafile.com/deploy/start_seafile_at_system_bootup.html but after server reboot the seafile don’t start.
My server running centos 6 x64

What did I do…
Step 1. Create a file /etc/sysconfig/seafile

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=/root/haiwen
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 true if fastcgi is to be used

fastcgi=true

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

fastcgi_port=8000

Step 2. Create a script /etc/rc.d/init.d/seafile
#!/bin/bash

seafile

chkconfig: - 68 32

description: seafile

Source function library.

. /etc/init.d/functions

Source networking configuration.

. /etc/sysconfig/network

if [ -f /etc/sysconfig/seafile ];then
. /etc/sysconfig/seafile
else
echo “Config file /etc/sysconfig/seafile not found! Bye.”
exit 200
fi

RETVAL=0

start() {
# Start daemons.
echo -n $“Starting seafile: "
ulimit -n 30000
su - ${user} -c”${script_path}/seafile.sh start >> ${seafile_init_log} 2>&1"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/seafile
return $RETVAL
}

stop() {
echo -n $“Shutting down seafile: "
su - ${user} -c”${script_path}/seafile.sh stop >> ${seafile_init_log} 2>&1"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/seafile
return $RETVAL
}

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}

See how we were called.

case “$1” in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
*)
echo $“Usage: $0 {start|stop|restart}”
RETVAL=3
esac

exit $RETVAL

Step 3. Create a script /etc/rc.d/init.d/seahub
#!/bin/bash

seahub

chkconfig: - 69 31

description: seahub

Source function library.

. /etc/init.d/functions

Source networking configuration.

. /etc/sysconfig/network

if [ -f /etc/sysconfig/seafile ];then
. /etc/sysconfig/seafile
else
echo “Config file /etc/sysconfig/seafile not found! Bye.”
exit 200
fi

RETVAL=0

start() {
# Start daemons.
echo -n $“Starting seahub: "
ulimit -n 30000
if [ $fastcgi = true ];
then
su - ${user} -c”${script_path}/seahub.sh start-fastcgi ${fastcgi_port} >> ${seahub_init_log} 2>&1"
else
su - ${user} -c"${script_path}/seahub.sh start >> ${seahub_init_log} 2>&1"
fi
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/seahub
return $RETVAL
}

stop() {
echo -n $“Shutting down seahub: "
su - ${user} -c”${script_path}/seahub.sh stop >> ${seahub_init_log} 2>&1"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/seahub
return $RETVAL
}

Write a polite log message with date and time

echo -e "\n \n About to perform $1 for seahub at date -Iseconds \n " >> ${seahub_init_log}

See how we were called.

case “$1” in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
*)
echo $“Usage: $0 {start|stop|restart}”
RETVAL=3
esac

exit $RETVAL

The seafile path is /root/haiwen

I have to do something else?

Regards,


#2

What error do you receive when you try to start it manually?


#3

I noticed you set fastcgi to true. Do you have Seafile configured for fastcgi? If you use NGinx or Apache, are they configured for fastcgi? Fastcgi is deprecated, though it still works. WSGI is the recommended way to run seafile now.


#4

I haven’t any error, start manually the seafile started


#5

The fastcgi to true is my mistake, i change this tto off but nothing happens…


#6

Are you still trying with systemd or are you now trying with init.d? If init.d, after you made the most recent changes, did you issue this command?

sudo update-rc.d seafile-server defaults


#7

Just realized you are using CENTOS… Hold on a minute… looking at the manual.


#8

Can you repost your startup file here since you’ve changed it from fastcgi? What commands are you running that start it manually, successfully.


#9

I’m seeing several things that could be the issue. Questions for you…

  • What user name do you use when you log into a terminal that successfully starts Seafile?
  • What commands are you using that successfully start Seafile?
  • What is the path of the folder where Seafile is installed?

#10

Hello,

  1. What user name do you use when you log into a terminal that successfully starts Seafile?
    root
    2.What commands are you using that successfully start Seafile?
    cd haiwen
    cd seafile-server-*
    ./seafile.sh start
    ./seahub.sh start 8000
    3.What is the path of the folder where Seafile is installed?
    The seafile path is /root/haiwen

#11

Can you check those two log files to see what’s in there? They may provide a clue since they are the files referenced in the script.


#12

Seagile log

[05/16/2018 04:54:40 PM] …/common/mq-mgr.c(54): [mq client] mq cilent is started
[05/16/2018 04:54:41 PM] size-sched.c(96): Repo size compute queue size is 0
[05/17/2018 12:10:58 PM] size-sched.c(96): Repo size compute queue size is 0
[05/17/2018 12:15:58 PM] size-sched.c(96): Repo size compute queue size is 0
[05/17/2018 12:20:58 PM] size-sched.c(96): Repo size compute queue size is 0
[05/17/2018 12:25:58 PM] size-sched.c(96): Repo size compute queue size is 0
[05/17/2018 12:30:58 PM] size-sched.c(96): Repo size compute queue size is 0
[05/17/2018 12:35:58 PM] size-sched.c(96): Repo size compute queue size is 0

Seahub log

2018-05-16 09:51:36,100 [WARNING] seahub.auth.views:144 login Login attempt limit reached, show Captcha, email/username: *****@hotmail.com, ip: 46.246.., attemps: 5

Nothing else…


#13

Can you take a look at your system log? Let’s see if there is any indication in there.