Hmmm… let me check something else…
Thank you! You are so nice~
I really wish we could see some system log files. In Linux, they are under /var/log. I think you mentioned earlier that your log file folder is /opt/var/log… What files and folders are in that folder?
Nothing… I worked around and didn’t find a way to enable the system log on Entware.
syslog-ng is one of the packages in entware-ng. So, I’m assuming that is the logger proggie. However, I’m uncertain how to configure or enable it. If we could enable logging, I think that we might be able to narrow this down further. I think I read somewhere that on entware-ng, it is preferable to send log files to a usb stick since the log files can get quite large fairly quickly.
Will check that soon… I’m now away from the router.
Well, if you have an Asus router, you can view the system log by logging into the web interface of the router… It’s under… System Log… How I forgot about that, I don’t know. My brain is fried.
But, considering that it’s a router, I would think that the log file might also be stored under the /tmp folder…
I installed syslog-ng and it do created a log file in /opt/var/log. I put it up here (I found nothing useful there. I guess I should configure the syslog-ng to log something special, but don’t know how to do it), however, no useful clue.
Here’s the log (I truncated some repeated messages):
Mar 23 15:21:47 K3B syslog-ng[7250]: syslog-ng starting up; version='3.9.1'
Mar 23 15:21:47 K3B kernel: wet_ip_proc: unable to find STA 192.168.43.181
Mar 23 15:21:47 K3B kernel: CONSOLE: 039315.837 wl0.0: wlc_send_bar: seq 0x53c tid 0
Mar 23 15:21:47 K3B kernel: CONSOLE: 039404.212 ##### external = 1 maxpwr = 35 ######
Mar 23 15:21:47 K3B kernel: CONSOLE: 039404.455 wl1: wlc_lq_chanim_update: WLC_CHANIM upd blocked scan/detect
Mar 23 15:21:47 K3B kernel: CONSOLE: 039404.455 wl1: wlc_watchdog: WLC_CHANIM upd fail -25
Mar 23 15:21:47 K3B kernel: CONSOLE: 039404.466 ##### external = 1 maxpwr = 35 ######
Mar 23 15:25:14 K3B syslog: unable to read /tmp/httpd.conf: No such file or directory
Mar 23 15:29:44 K3B websocket: websocket iptable loss,recover ok!
Mar 23 15:35:48 K3B kernel: CONSOLE: 040904.658 pciedev_send_ltr:Giving up:0x302
Mar 23 15:50:27 K3B kernel: CONSOLE: 041780.308 ampdu_dbg: wl0.0 scb:0036cf0c tid:0
Mar 23 15:50:27 K3B kernel: CONSOLE: 041780.308 ampdu_dbg: wl0.0 dead_cnt 2 tx_in_transit 77 psm_mux 0xfff0 aqmqmap 0x0x101 aqmfifo_status 0x0x49 fifordy 0x2 cpbusy 0x0
While the router do have a log in the /tmp folder, but nothing useful was found, either:
Mar 23 16:30:56 K3B syslog.info syslogd started: BusyBox v1.7.2
Mar 23 16:30:56 K3B user.notice app: my app start!
Mar 23 16:30:56 K3B daemon.info dnsmasq[1359]: started, version 2.76 cachesize 150
Mar 23 16:30:56 K3B daemon.debug dnsmasq[1359]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset no-auth no-DNSSEC no-loop-detect no-inotify
Mar 23 16:30:56 K3B daemon.info dnsmasq[1359]: read /etc/hosts - 3 addresses
Mar 23 16:30:56 K3B daemon.info dnsmasq[1359]: using nameserver 192.168.43.1#53
Mar 23 16:31:00 K3B cron.notice crond[1407]: crond 1.7.2 started, log level 8
Mar 23 16:31:00 K3B user.err syslog: password for ‘admin’ changed
Mar 23 16:31:00 K3B authpriv.info dropbear[1435]: Running in background
Mar 23 16:36:46 K3B authpriv.info dropbear[4294]: Child connection from 10.10.10.100:53034
Mar 23 16:36:51 K3B authpriv.notice dropbear[4294]: Password auth succeeded for ‘admin’ from 10.10.10.100:53034
Well, shoot… I’m running out of ideas. All we have is Seafile failed to start, yet it actually spawns the process. Seems to me that if you were running out of memory, that should be logged in the system file. I’m not certain the chain of events that occur when Seafile starts, but I can try to follow the code and come up with a list of things it does when it starts. I’ll dig into it sometime this evening. I’m not willing to give up so easily. 
I just thought about something. What firmware version are you on? When is the last time you updated it? Asus has had a string of bugs in several versions the last few go-arounds.
Still, check your firmware, but here is the code that is responsible for throwing the error:
# check if seafile server started successfully
if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
echo "Failed to start seafile server"
exit 1;
fi
So, what it does is checks running processes for the existence of the seafile controller running and making certain that the default ccnet folder is in the list. So, check your processes for the existence of seafile controller and make certain that the correct ccnet folder is in there. The command to do that is ps -aux. You can grep if you want to.
Here is an example, though your folders and version will be different than mine This should be what it’s looking for as the first part… There will be more parameters in your process list, but this is the important one:
/home/Seafile-Server/seafile-server-6.2.4/seafile/bin/seafile-controller -c /home/Seafile-Server/ccnet
After you’ve verified that process is running, verify that the folder paths exist, and also check the permissions and ownership of the ccnet folder.
One other note: It’s also possible that pgrep is not working/not installed on your router. You can verify whether or not it exists by typing “pgrep --help” at a prompt.
I checked Seahub. It performs the same exact test to see if the controller is running or not. This should help us narrow this down.
Sorry for the late reply… got to take care of the children in the weekend.
Really appreciate your effort, and I checked the serfile-controller process, these are what I found via running “top”:
2851 1 Seafile S 116M 23.0 0.0 seaf-server -F /opt/share/seafile/conf -c /opt/share/seafile/ccnet -d /opt/share/seafile/seafile-data -l /opt/share/seafile/logs/seafi
2846 1 Seafile S 14116 2.7 0.0 ccnet-server -F /opt/share/seafile/conf -c /opt/share/seafile/ccnet -f /opt/share/seafile/logs/ccnet.log -d -P /opt/var/run/seafile/cc
2844 1 Seafile S 10176 1.9 0.0 /opt/bin/seafile-controller -c /opt/share/seafile/ccnet -d /opt/share/seafile/seafile-data -F /opt/share/seafile/conf
and here’s the folders in “/opt/share/seafile/”
[K3 /tmp/share/sda1/opt/share/seafile]$ ls
ccnet seafile-data seahub-data
conf seafile-server seahub.db
logs seafile-server-latest
So, yes, seafile-controller is running
BTW, the router is not an Asus router, but is a Phicomm router, the firmware is not the same as the Asus one. And I will try to map the 22 port on my gateway to see if you can login into my router with SSH remotely, so that you can check the system 
No problem. Will be happy to check it out.
So, the text below is what the code is looking for. But, I believe that’s the problem. Notice that seafile-controller is running from /opt/bin. It should be running from /opt/share/seafile/seafile-server. Where does your seafile-server-latest link to?
I guess the seafile-controller was started by the script (in /opt/etc/init.d/S66seafile.sh), and there’s no script to start seafile-controller in /opt.share/seafile/seafile-server.
Here’s the folder linked by “seafile-server-latest”, and it was generated automatically during installation:
[K3 /tmp/share/sda1/opt/share/seafile]$ ls -l
drwxrwxrwx 6 Seafile root 4096 Mar 26 2018 ccnet
drwxrwxrwx 2 Seafile root 4096 Mar 22 2018 conf
drwxr-xr-x 2 Seafile Seafile 4096 Mar 23 2018 logs
drwxrwxrwx 8 Seafile root 4096 Mar 22 2018 seafile-data
drwxrwxrwx 6 Seafile root 4096 Mar 22 2018 seafile-server
lrwxrwxrwx 1 admin root 14 Mar 22 2018 seafile-server-latest -> seafile-server
drwxrwxrwx 3 Seafile root 4096 Mar 22 2018 seahub-data
-rwxrwxrwx 1 Seafile root 716800 Mar 22 2018 seahub.db
and here’s the folder and files in “seafile-server”:
[K3 /tmp/share/sda1/opt/share/seafile/seafile-server]$ ls -l
-rwxrwxrwx 1 Seafile root 11322 Jan 4 16:53 check_init_admin.py
drwxrwxrwx 2 Seafile root 4096 Mar 22 11:47 runtime
-rwxrwxrwx 1 Seafile root 1942 Jan 4 16:53 seaf-fsck.sh
-rwxrwxrwx 1 Seafile root 2837 Jan 4 16:53 seaf-gc.sh
drwxrwxrwx 2 Seafile root 4096 Jan 4 16:53 seafile
-rwxrwxrwx 1 Seafile root 4717 Jan 4 16:53 seafile.sh
drwxrwxrwx 11 Seafile root 4096 Mar 22 11:46 seahub
-rwxrwxrwx 1 Seafile root 7737 Jan 4 16:53 seahub.sh
-rwxrwxrwx 1 Seafile root 52792 Jan 4 16:53 setup-seafile-mysql.py
-rwxrwxrwx 1 Seafile root 2207 Jan 4 16:53 setup-seafile-mysql.sh
-rwxrwxrwx 1 Seafile root 22010 Jan 4 16:53 setup-seafile.sh
-rwxrwxrwx 1 Seafile root 2695 Jan 4 16:53 sqlite2mysql.py
-rwxrwxrwx 1 Seafile root 5042 Jan 4 16:53 sqlite2mysql.sh
drwxrwxrwx 4 Seafile root 4096 Mar 22 11:47 upgrade
I am stuggling with the public IP now, I don’t know whether I can get one from my ISP… I got to have one to enable remote login via internet.
Here’s the seafile.sh (I use this to start seafile-server):
#!/opt/bin/bash
### BEGIN INIT INFO
# Provides: seafile
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs
# Default-Start: 1 2 3 4 5
# Default-Stop:
# Short-Description: Starts Seafile Server
# Description: starts Seafile Server
### END INIT INFO
echo ""
SCRIPT=/opt/share/seafile/seafile-server/0.sh
INSTALLPATH=$(dirname "${SCRIPT}")
TOPDIR=$(dirname "${INSTALLPATH}")
default_ccnet_conf_dir=${TOPDIR}/ccnet
central_config_dir=${TOPDIR}/conf
seaf_controller="/opt/bin/seafile-controller"
export PATH=${INSTALLPATH}/seafile/bin:$PATH
export ORIG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
script_name=$0
function usage () {
echo "usage : "
echo "$(basename ${script_name}) { start | stop | restart } "
echo ""
}
# check args
if [[ $# != 1 || ( "$1" != "start" && "$1" != "stop" && "$1" != "restart" ) ]]; then
usage;
exit 1;
fi
function validate_ccnet_conf_dir () {
if [[ ! -d ${default_ccnet_conf_dir} ]]; then
echo "Error: there is no ccnet config directory."
echo "Have you run setup-seafile.sh before this?"
echo ""
exit -1;
fi
}
function validate_central_conf_dir () {
if [[ ! -d ${central_config_dir} ]]; then
echo "Error: there is no conf/ directory."
echo "Have you run setup-seafile.sh before this?"
echo ""
exit -1;
fi
}
function read_seafile_data_dir () {
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
if [[ ! -f ${seafile_ini} ]]; then
echo "${seafile_ini} not found. Now quit"
exit 1
fi
seafile_data_dir=$(cat "${seafile_ini}")
if [[ ! -d ${seafile_data_dir} ]]; then
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
echo "Please check it first, or create this directory yourself."
echo ""
exit 1;
fi
}
function test_config() {
if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} --test \
-c "${default_ccnet_conf_dir}" \
-d "${seafile_data_dir}" \
-F "${central_config_dir}" ; then
exit 1;
fi
}
function check_component_running() {
name=$1
cmd=$2
if pid=$(pgrep -f "$cmd" 2>/dev/null); then
echo "[$name] is running, pid $pid. You can stop it by: "
echo
echo " kill $pid"
echo
echo "Stop it and try again."
echo
exit
fi
}
function validate_already_running () {
if pid=$(pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null); then
echo "Seafile controller is already running, pid $pid"
echo
exit 1;
fi
check_component_running "ccnet-server" "ccnet-server -c ${default_ccnet_conf_dir}"
check_component_running "seaf-server" "seaf-server -c ${default_ccnet_conf_dir}"
check_component_running "fileserver" "fileserver -c ${default_ccnet_conf_dir}"
check_component_running "seafdav" "wsgidav.server.run_server"
}
function start_seafile_server () {
validate_already_running;
validate_central_conf_dir;
validate_ccnet_conf_dir;
read_seafile_data_dir;
test_config;
echo "Starting seafile server, please wait ..."
mkdir -p $TOPDIR/logs
LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} \
-c "${default_ccnet_conf_dir}" \
-d "${seafile_data_dir}" \
-F "${central_config_dir}"
sleep 3
# check if seafile server started successfully
if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
echo "Failed to start seafile server"
exit 1;
fi
echo "Seafile server started"
echo
}
function stop_seafile_server () {
if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
echo "seafile server not running yet"
return 1;
fi
echo "Stopping seafile server ..."
pkill -SIGTERM -f "seafile-controller -c ${default_ccnet_conf_dir}"
pkill -f "ccnet-server -c ${default_ccnet_conf_dir}"
pkill -f "seaf-server -c ${default_ccnet_conf_dir}"
pkill -f "fileserver -c ${default_ccnet_conf_dir}"
pkill -f "soffice.*--invisible --nocrashreport"
pkill -f "wsgidav.server.run_server"
return 0
}
function restart_seafile_server () {
stop_seafile_server;
sleep 2
start_seafile_server;
}
case $1 in
"start" )
start_seafile_server;
;;
"stop" )
stop_seafile_server;
;;
"restart" )
restart_seafile_server;
esac
echo "Done."
I just find it odd that seafile server is starting from that folder. It makes me think that future updates will not update that controller file in that folder, but rather the seafile-server folder, which is in opt/share.
Seafile-controller runs from my seafile-server/seafile/bin…
How that controller got setup in that folder is beyond me, but I’m thinking that may be a clue to your problem. Check your seafile-server/seafile/bin folder and see if the controller is in there. Note the date and time on it and then compare that to the controller script in /opt/bin.
As for a static IP, no worries there… You can get a domain name and setup DDNS in it and never have to worry about it again. I use Namecheap for my domains. Basically, you set your domain up and there is a place in there where it will automatically read your IP address and add the A record for you. Then, all you’ll need to do is grab a DDNS updater client and add your keys to it. I use Namecheap’s updater.
Another quick question… From which folder are you starting the seafile and seahub scripts? Also, are you using the same user id that you used to setup Seafile? Starting Seafile as root can cause major headaches and is not recommended in the Seafile manual.
The soft package gave me an instruction to start seafile from /opt/etc/init.d during installation, and I started seafile there using account “Seafile”.
I sent you the account to login into my router in private message.
Ok, I looked at your Seafile.sh script and it’s different that mine. I think I see the problem. Here’s mine: Compare it to yours and you’ll see what I mean.
SCRIPT=$(readlink -f “$0”)
INSTALLPATH=$(dirname “${SCRIPT}”)
TOPDIR=$(dirname “${INSTALLPATH}”)
default_ccnet_conf_dir=${TOPDIR}/ccnet
central_config_dir=${TOPDIR}/conf
seaf_controller="${INSTALLPATH}/seafile/bin/seafile-controller"
export PATH=${INSTALLPATH}/seafile/bin:$PATH
export ORIG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
Note your “SCRIPT=” path. First, notice that 0.sh is not in the referenced folder… That’s not really important since the next line strips out the 0.sh. Now, on the next line, it will use it as your install path. And then, your TOPDIR path is keying off of that. All of those are in opt/share, as are the default ccnet and central config folders.
Then, notice where the seafile controller is starting from. Next, your PATH is then setup to use the seafile/bin folder appended to your install path, which is in opt/share. Same for your Seafile Library path.
Basically, what I’m getting to is everything is running from the correct seafile-server folder, except for the controller. And, that “SCRIPT =” is referencing something that doesn’t even exist, though, it doesn’t need to really exist.
What my script does is read the folder from which seafile.sh is started, which should be in seafile-server.
So, INSTALLPATH in your case will be /opt/share/seafile/seafile-server
TOPDIR will be /opt/share/seafile
default_ccent_conf_dir will be /opt/share/seafile/ccnet
central_config_dir will be /opt/share/seafile/conf
But, your controller is hard coded for /opt/bin/seafile-controller. In my opinion, it should be /opt/share/seafile/seafile-server/seafile/bin/seafile-controller.