When upgrading Seafile from 7.0 to 7.1, there might be a couple of hiccups when running the upgrade or starting the newly upgraded Seafile. The main reason is that support for python2 (which has been around for many many years) was removed and Seafile 7.1 now requires python3.
Note: Upgrading to Seafile 7.1 is only supported from Seafile 7.0. Older Seafile versions need first to upgrade to 7.0.
Upgrade script does not work
In case the upgrade script cannot find python3, it will fail with an error like this:
seafile@seafile:~$ /pub/haiwen/seafile-server-7.1.5/upgrade/upgrade_7.0_7.1.sh
————————————————————-
This script would upgrade your seafile server from 7.0 to 7.1
Press [ENTER] to contiune
————————————————————-
The current version of python is not 3.x.x, please use Python 3.x.x .
On a Debian/Ubuntu and other deb based Linux, simply install python3:
root@seafile:~# apt-get install python3
The upgrade script will then run:
seafile@seafile:~$ /pub/haiwen/seafile-server-7.1.5/upgrade/upgrade_7.0_7.1.sh
————————————————————-
This script would upgrade your seafile server from 7.0 to 7.1
Press [ENTER] to contiune
————————————————————-
renaming the gunicorn.conf to gunicorn.conf.py …
Done
Updating seafile/seahub database …
[INFO] You are using SQLite3
[INFO] updating seahub database…
Done
migrating avatars …
Done
updating /pub/haiwen/seafile-server-latest symbolic link to /pub/haiwen/seafile-server-7.1.5 …
——————————————————————
Upgraded your seafile server successfully.
——————————————————————
Seahub not starting
If you are upgrading from Seafile 6.x to Seafile 7.0, you might have started seahub in fastcgi mode in the past. This is not supported anymore. Check out our article Solve Seahub start problems after Seafile upgrade from 6.2 to 7.0 for more details.
But if your existing Seafile installation was already on 7.0 and seahub is still not starting, you might see this error:
seafile@seafile:/pub/haiwen/seafile$ ./seahub.sh start
Starting seahub at port 8000 …
Error:Seahub failed to start.
Please try to run «./seahub.sh start» again
Unfortunately no error is showing up. However if seahub script is started in verbose mode, more details are showing up:
seafile@seafile:/pub/haiwen/seafile$ bash -xv ./seahub.sh start
#!/bin/bash
[…]
+ export CCNET_CONF_DIR=/pub/haiwen/ccnet
+ CCNET_CONF_DIR=/pub/haiwen/ccnet
+ export SEAFILE_CONF_DIR=/pub/haiwen/seafile-data
+ SEAFILE_CONF_DIR=/pub/haiwen/seafile-data
+ export SEAFILE_CENTRAL_CONF_DIR=/pub/haiwen/conf
+ SEAFILE_CENTRAL_CONF_DIR=/pub/haiwen/conf
+ export SEAFILE_RPC_PIPE_PATH=/pub/haiwen/seafile-server-7.1.5/runtime
+ SEAFILE_RPC_PIPE_PATH=/pub/haiwen/seafile-server-7.1.5/runtime
+ export PYTHONPATH=/pub/haiwen/seafile-server-7.1.5/seafile/lib/python3.6/site-packages:/pub/haiwen/seafile-server-7.1.5/seafile/lib64/python3.6/site-packages:/pub/haiwen/seafile-server-7.1.5/seahub:/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart:
+ PYTHONPATH=/pub/haiwen/seafile-server-7.1.5/seafile/lib/python3.6/site-packages:/pub/haiwen/seafile-server-7.1.5/seafile/lib64/python3.6/site-packages:/pub/haiwen/seafile-server-7.1.5/seahub:/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart:
+ warning_if_seafile_not_running
+ pgrep -f ‘seafile-controller -c /pub/haiwen/ccnet’
+ validate_seahub_running
+ pgrep -f /pub/haiwen/seafile-server-7.1.5/seahub/manage.py
+ pgrep -f seahub.wsgi:application
+ prepare_seahub_log_dir
+ logdir=/pub/haiwen/logs
+ [[ -d » ]]
+ mkdir -p /pub/haiwen/logs
+ export SEAHUB_LOG_DIR=/pub/haiwen/logs
+ SEAHUB_LOG_DIR=/pub/haiwen/logs
+ echo ‘Starting seahub at port 8000 …’
Starting seahub at port 8000 …
+ check_init_admin
+ check_init_admin_script=/pub/haiwen/seafile-server-7.1.5/check_init_admin.py
+ python3 /pub/haiwen/seafile-server-7.1.5/check_init_admin.py
+ python3 /pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /pub/haiwen/conf/gunicorn.conf.py —preload
+ sleep 5
+ pgrep -f seahub.wsgi:application
+ printf ’33[33mError:Seahub failed to start.33[mn’
The interesting part here is that the start command using thirdpart/bin/gunicorn seems to fail.
A manual run of this command shows why:
seafile@seafile:~$ python3 /pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /pub/haiwen/conf/gunicorn.conf.py —preload
Traceback (most recent call last):
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/bin/gunicorn», line 5, in <module>
from gunicorn.app.wsgiapp import run
ImportError: No module named ‘gunicorn’
The reason for this is that Seafile now requires additional python modules which can be installed using pip3.
First prepare pip3 and setuptools, then install additional Python modules:
root@seafile:~# apt-get install python3 python3-setuptools python3-pip
root@seafile:~# sudo pip3 install —timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy==1.3.8 django-pylibmc django-simple-captcha python3-ldap
Seahub should now start:
seafile@seafile:~$ /pub/haiwen/seafile/seahub.sh start
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …
Seahub is started
Done.
Internal server error
When visiting Seafile’s web address, an Internal Server Error is showing up instead of the Seafile web interface. The seahub.log file can show more information what is happening in the background:
seafile@seafile:/pub/haiwen/logs$ tail -f seahub.log
[…]
2021-04-09 12:54:37,384 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /
Traceback (most recent call last):
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/core/handlers/exception.py», line 41, in inner
response = get_response(request)
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/core/handlers/base.py», line 244, in _legacy_get_response
response = middleware_method(request)
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/middleware/locale.py», line 24, in process_request
i18n_patterns_used, prefixed_default_language = is_language_prefix_patterns_used(urlconf)
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/conf/urls/i18n.py», line 29, in is_language_prefix_patterns_used
for url_pattern in get_resolver(urlconf).url_patterns:
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/utils/functional.py», line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/urls/resolvers.py», line 407, in url_patterns
patterns = getattr(self.urlconf_module, «urlpatterns», self.urlconf_module)
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/utils/functional.py», line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File «/pub/haiwen/seafile-server-7.1.5/seahub/thirdpart/django/urls/resolvers.py», line 400, in urlconf_module
return import_module(self.urlconf_name)
[…]
Although there is no real hint showing up in this error trace, the reason is that Seafile 7.1 requires Python 3.6 or newer. If you are running an Ubuntu 16.04 or Debian 9 (Stretch) server, you most likely have Python 3.5 when you installed the python3 package. This means you need to upgrade your distribution or manually compile and install a newer Python 3 release.
Dedicated Seafile hosting
Looking for a secure Seafile file cloud server but without the hassle of setup, configuration and troubleshooting? Check out the Private File Cloud Server offers on Infiniroot.
Add a comment
Show form to leave a comment
Comments (newest first)
No comments yet.
Как я могу установить и настроить Seafile на CentOS 8 ?. Сервер Seafile — это корпоративная платформа для самостоятельного размещения файлов с открытым исходным кодом, созданная для обеспечения производительности и высокой надежности. Seafile позволяет размещать файлы на собственном сервере и разрешать различным устройствам синхронизировать их и получать к ним доступ. Вы также можете получить доступ ко всем файлам как к виртуальному диску. В этом блоге мы рассмотрим, как установить и настроить сервер обмена файлами Seafile на CentOS 8.
Ниже приведены некоторые из важных особенностей Seafile, которые делают надежную платформу для обмена файлами:
- Шифрование файлов
- Блокировка файлов
- Онлайн-редактирование и совместное редактирование
- Управление версиями файлов и моментальные снимки
- Мобильный доступ к файлам
- Легко установить и использовать клиент
- Общий доступ к файлам и контроль разрешений
Установите сервер хранения Seafile на CentOS 8
Это шаги, которые вы выполните, чтобы установить и настроить Seafile Storage Server в системе CentOS 8.
Шаг 1. Обновите систему и установите имя хоста
Сначала мы отключим CentOS selinux, чтобы убедиться, что он не помешает какой-либо установке, которую мы собираемся выполнить.
$ sudo vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
После отключения Selinux запустите обновления на CentOS 8.
sudo dnf -y update
sudo dnf -y upgrade
Теперь настройте файл hosts и установите имя хоста сервера.
sudo hostnamectl set-hostname seafile.example.com
echo “<your-server-ip> seafile.example.com” | sudo tee -a /etc/hosts
Перезагрузите вашу систему
sudo reboot
Шаг 2. Добавьте репозиторий EPEL и установите зависимости
Сначала давайте установим зависимости Seafile и необходимые пакеты
sudo dnf -y install epel-release
sudo dnf -y install python3 python3-imaging MySQL-python3 python3-simplejson python3-setuptools mariadb mariadb-server nginx
Шаг 3. Добавьте репозиторий EPEL и установите зависимости
Сначала давайте установим зависимости Seafile и необходимые пакеты
sudo systemctl start mariadb
sudo systemctl enable mariadb
Безопасная установка mariadb и установка пароля root.
$ sudo mysql_secure_installation
Enter current password for root (enter for none): Press Enter
Set root password? [Y/n] y
New password: Enter New Password
Re-enter new password: Repeat New Password
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
Шаг 4: Создайте базы данных Seafile
Настроив MariaDB, мы продолжим создание пользователя и баз данных Seafile. Подключитесь к MySQL с помощью приведенной ниже команды и введите пароль, который вы установили выше.
mysql -u root -p
Мы создадим пользователя для Seafile и следующих трех баз данных:
- ccnet_db
- seafile_db
- seahub_db
После подключения к MySQL выполните следующие команды для создания необходимых баз данных:
create database ccnet_db character set = 'utf8';
create database seafile_db character set = 'utf8';
create database seahub_db character set = 'utf8';
create user seacloud@localhost identified by 'yourpassword';
grant all privileges on ccnet_db.* to seacloud@localhost identified by 'yourpassword';
grant all privileges on seafile_db.* to seacloud@localhost identified by 'yourpassword';
grant all privileges on seahub_db.* to seacloud@localhost identified by 'yourpassword';
flush privileges;
exit
Шаг 5: Установка Seafile на CentOS 8
Мы собираемся установить Seafile по пути /var/www.
sudo mkdir -p /var/www/seafile
cd /var/www/seafile
Загрузите Seafile с помощью команды wget и распакуйте загруженный архив.
wget https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_7.1.5_x86-64.tar.gz
Распакуйте загруженный файл
sudo tar xvf seafile-server_7.1.5_x86-64.tar.gz
Переименуйте каталог в seafile-server и переключитесь в этот каталог.
sudo mv seafile-server-7.1.5/ seafile-server
Шаг 6: Настройте Seafile на CentOS 8
Выполнить « setup-seafile-mysql.sh » файл для настройки базы данных.
$ cd seafile-server
$ sudo ./setup-seafile-mysql.sh
Checking python on this machine ...
-----------------------------------------------------------------
This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at
https://download.seafile.com/published/seafile-manual/home.md
Press ENTER to continue
-----------------------------------------------------------------
What is the name of the server? It will be displayed on the client.
3 - 15 letters or digits
[ server name ] seafile
What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server's ip or domain ] seafile.example.com
Which port do you want to use for the seafile fileserver?
[ default "8082" ]
-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------
[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases
[ 1 or 2 ] 2
What is the host of mysql server?
[ default "localhost" ] press Enter
What is the port of mysql server?
[ default "3306" ] Press Enter
Which mysql user to use for seafile?
[ mysql user for seafile ] seacloud
What is the password for mysql user "seahub"?
[ password for seahub ] Enter seacloud password
verifying password of user seacloud ... done
Enter the existing database name for ccnet:
[ ccnet database ] ccnet_db
verifying user "seacloud" access to database ccnet_db ... done
Enter the existing database name for seafile:
[ seafile database ] seafile_db
verifying user "seacloud" access to database seafile_db ... done
Enter the existing database name for seahub:
[ seahub database ] seahub_db
verifying user "seacloud" access to database seahub_db ... done
---------------------------------
This is your configuration
---------------------------------
server name: seafile
server ip/domain: seafile.example.com
seafile data dir: /var/www/seafile/seafile-data
fileserver port: 8082
database: use existing
ccnet database: ccnet_db
seafile database: seafile_db
seahub database: seahub_db
database user: seacloud
---------------------------------
Press ENTER to continue, or Ctrl-C to abort
---------------------------------
Generating ccnet configuration ...
done
Successly create configuration dir /var/www/seafile/ccnet.
Generating seafile configuration ...
Done.
done
Generating seahub configuration ...
----------------------------------------
Now creating ccnet database tables ...
----------------------------------------
----------------------------------------
Now creating seafile database tables ...
----------------------------------------
----------------------------------------
Now creating seahub database tables ...
----------------------------------------
creating seafile-server-latest symbolic link ... done
-----------------------------------------------------------------
Your seafile server configuration has been finished successfully.
-----------------------------------------------------------------
run seafile server: ./seafile.sh { start | stop | restart }
run seahub server: ./seahub.sh { start <port> | stop | restart <port> }
-----------------------------------------------------------------
If you are behind a firewall, remember to allow input/output of these tcp ports:
-----------------------------------------------------------------
port of seafile fileserver: 8082
port of seahub: 8000
When problems occur, Refer to
https://download.seafile.com/published/seafile-manual/home.md
for information.
Теперь мы можем запустить сервисы seafile и seahub. Запустите seafile с помощью следующей команды:
$ sudo ./seafile.sh start
[08/17/20 11:16:33] ../common/session.c(148): using config file /var/www/seafile/conf/ccnet.conf
Starting seafile server, please wait ...
** Message: seafile-controller.c(563): No seafevents.
Seafile server started
Done.
Запустить сервис seahub
$ ./seahub.sh start
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
----------------------------------------
It's the first time you start the seafile server. Now let's create the admin account
----------------------------------------
What is the email for the admin account?
[ admin email ] admin@example.com
What is the password for the admin account?
[ admin password ] Enter Admin password
Enter the password again:
[ admin password again ] Repeat Admin password
----------------------------------------
Successfully created seafile admin
----------------------------------------
!!!
!!! WARNING: configuration file should have a valid Python extension.
!!!
Error:Seahub failed to start.
Please try to run "./seahub.sh start" again
Seahub Failed to start.
Как видно из вывода выше, seahub не запустился. Чтобы получить связанную ошибку, запустите seafile с помощью следующей команды:
$ sudo ./seahub.sh start-fastcgi
from _sha1 import sha1
ModuleNotFoundError: No module named '_sha1'
Error:Seahub failed to start.
Выходные данные показывают, что ошибка связана с не поддерживаемым sha1. Я решил эту проблему, заменив « from _sha1 import sha1 » на « import hashlib » в файле /var/www/seafile/seafile-server/seahub/seahub/repo_api_tokens/models.py . Файл выглядит следующим образом:
$ sudo vim /var/www/seafile/seafile-server/seahub/seahub/repo_api_tokens/models.py
import hashlib
import hmac
import uuid
from django.db import models
Сохраните файл и снова запустите seahub
$sudo ./seafile.sh start
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
Seahub is started
Done.
Шаг 7. Настройте брандмауэр
Если ваш файловый экран активен, убедитесь, что порты seafile открыты через брандмауэр:
sudo firewall-cmd –permanent –add-port=8000/tcp
sudo firewall-cmd –permanent –add-port=8082/tcp
sudo firewall-cmd --reload
Шаг 8: Доступ к Seafile в браузере
Получите доступ к seafile из вашего браузера, используя ваше имя хоста / IP-адрес на порту 8000: http://<your-hostname>: 8000 . Если вы обнаружите, что ваш seafile не загружается в браузере, проверьте конфигурацию seafile gunicorn. Убедитесь, что он не привязан к локальному IP-адресу, как показано ниже:
$ sudo vim /var/www/seafile/conf/gunicorn.conf.py
# default localhost:8000
#bind = 127.0.0.1:8000
bind = "0.0.0.0:8000"
Сохраните файл, и вы сможете запустить seafile в браузере. Вы должны увидеть страницу, как показано ниже:
Войдите в систему с учетными данными администратора, которые вы настроили ранее, и вы должны получить страницу, как показано:
Чтобы начать добавлять новые папки / файлы, нажмите «Новая библиотека» и укажите имя для своей новой папки, затем нажмите «Отправить».
У вас должна быть возможность выбрать новую библиотеку и либо создать, либо загрузить папку / файл.
Шаг 9: Настройка клиент Seafile
Мы будем использовать клиентский компьютер Ubuntu 20.04 для проверки возможности подключения к серверу Seafile.
Чтобы подключиться к Seafile в Ubuntu 20.04, сначала выполните приведенную ниже команду, чтобы установить клиент seafile в Ubuntu 20.04.
$ sudo wget https://linux-clients.seafile.com/seafile.asc -O /usr/share/keyrings/seafile-keyring.asc
$ sudo bash -c "echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/seafile-keyring.asc] https://linux-clients.seafile.com/seafile-deb/focal/ stable main' > /etc/apt/sources.list.d/seafile.list"
$ sudo apt update
$ sudo apt install -y seafile-gui
Только для использования cli выполните команду:
sudo apt-get install seafile-cli
После установки найдите клиент seafile в своих приложениях, и вы должны его увидеть.
Дважды щелкните, чтобы открыть и выбрать папку для ваших библиотек, и нажмите кнопку «Далее».
Теперь предоставьте сведения для подключения к вашему серверу seafile:
Когда вы нажимаете « Войти », вы должны подключиться к серверу seafile, как показано:
Вот и все. Наслаждайтесь установкой Seafile. Надеюсь, блог был информативным.
I’ve tried signing up on the official Seafile forums with 2 different email addresses, and I’m just not getting the email verification I need to be able to post, and yeah, I checked my spam folders.
I followed the official Seafile documentation to set it up (Seafile Server for Raspberry Pi Version 7.0.5 on a Raspberry Oi 4B 4Gb RAM) with MariaDB instead of MySQL, which seems to be fine. Now, I’ve used Apache before several years ago when I had a website, but I wanted to try Nginx as I heard it uses less RAM which is good on a Pi. (Perhaps I’m taking on a lot, trying to learn Nginx as well as Linux.) Anyway, I followed all the deployment instructions for Nginx and in Terminal, I get the error Seahub.sh failed to start, please try to start seahub.sh again. I can confirm Nginx is running as I get the welcome to Nginx message on port 80. I edited the gunicorn.conf file as mentioned to bind 0.0.0.0 to port 8000 and that hasn’t fixed it. The seahub.log file is empty. Here’s the content of cconf.log (From default they use the organization name of Huawei which I changed to Katcloud). I’m kind of at a loss for what to try next. I’ve searched for local peer down and haven’t found anything that looks relevant — mostly things that apply to older versions of Seafile. When I go to 192.168.1.27:8000 which is the correct IP and port, I just get a could not connect to server error. I did add DEBUG=True to seahub_settings.py but since seahub.sh can’t start it doesn’t seem to be making any difference. Nothing is showing up when I try to load the page or in the seahub.log file.
[12/28/19 03:23:38] ../common/session.c(132): using config file /home/pi/katcloud/conf/ccnet.conf [12/28/19 03:23:38] ../common/session.c(455): socket file exists, delete it anyway [12/28/19 03:23:38] ../common/session.c(484): Listen on /home/pi/katcloud/ccnet/ccnet.sock for local clients [12/28/19 03:23:38] ../common/session.c(290): Update pubinfo file [12/28/19 03:23:39] ../common/session.c(398): Accepted a local client [12/28/19 03:23:39] ../common/session.c(398): Accepted a local client [12/28/19 03:23:39] ../common/session.c(398): Accepted a local client [12/28/19 03:23:39] ../common/session.c(398): Accepted a local client [12/28/19 03:23:53] ../common/session.c(398): Accepted a local client [12/28/19 03:23:53] ../common/peer.c(943): Local peer down [12/28/19 04:15:47] ../common/session.c(369): Exit at Sat Dec 28 04:15:47 2019 [12/28/19 04:15:49] ../common/session.c(132): using config file /home/pi/katcloud/conf/ccnet.conf [12/28/19 04:15:49] ../common/session.c(455): socket file exists, delete it anyway [12/28/19 04:15:49] ../common/session.c(484): Listen on /home/pi/katcloud/ccnet/ccnet.sock for local clients [12/28/19 04:15:49] ../common/session.c(290): Update pubinfo file [12/28/19 04:15:50] ../common/session.c(398): Accepted a local client [12/28/19 04:15:50] ../common/session.c(398): Accepted a local client [12/28/19 04:15:50] ../common/session.c(398): Accepted a local client [12/28/19 04:15:50] ../common/session.c(398): Accepted a local client [12/28/19 04:16:02] ../common/session.c(398): Accepted a local client [12/28/19 04:16:02] ../common/peer.c(943): Local peer down [12/28/19 04:16:27] ../common/session.c(398): Accepted a local client [12/28/19 04:16:27] ../common/peer.c(943): Local peer down [12/28/19 04:25:39] ../common/session.c(398): Accepted a local client [12/28/19 04:25:39] ../common/peer.c(943): Local peer down
Настроим автозапуск сервера Seafile при загрузке системы.
https://download.seafile.com/published/seafile-manual/deploy/start_seafile_at_system_bootup.md
Для systemd
Debian 8 и старше, Linux Ubuntu 15.04 и старше
${seafile_dir} — измените переменную на путь к вашей директории Seafile.
Работаем под рутом. Создаём сервис seafile:
sudo vim /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
[Service]
Type=forking
ExecStart=${seafile_dir}/seafile-server-latest/seafile.sh start
ExecStop=${seafile_dir}/seafile-server-latest/seafile.sh stop
LimitNOFILE=infinity
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
Создаём сервис seahub:
sudo vim /etc/systemd/system/seahub.service
Содержимое:
[Unit]
Description=Seafile hub
After=network.target seafile.service
[Service]
Type=simple
# change start to start-fastcgi if you want to run fastcgi
ExecStart=${seafile_dir}/seafile-server-latest/seahub.sh start
ExecStop=${seafile_dir}/seafile-server-latest/seahub.sh stop
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
Если seahub останавливается после запуска, меняем тип на forking:
[Service]
Type=forking
Запускаем сервисы и настраиваем автозагрузку:
systemctl daemon-reload
systemctl start seafile
systemctl start seahub
systemctl enable seafile
systemctl enable seahub
Проверяем:
systemctl status seafile
systemctl status seahub
Если вы используете seafile console client, то понадобится ещё один сервис seafile-client.
vim /etc/systemd/system/seafile-client.service
Содержимое:
[Unit]
Description=Seafile client
# Uncomment the next line you are running seafile client on the same computer as server
# After=seafile.service
# Or the next one in other case
# After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/seaf-cli start
ExecStop=/usr/bin/seaf-cli stop
RemainAfterExit=yes
User=seafile
Group=seafile
[Install]
WantedBy=multi-user.target
Включаем автозагрузку сервисов:
sudo systemctl enable seafile.service
sudo systemctl enable seahub.service
sudo systemctl enable seafile-client.service # optional
Для init.d
Ubuntu 14.10 и старше
Для Ubuntu без systemd нужно использовать /etc/init.d/ скрипты.
Создаём скрипт seafile-server:
sudo vim /etc/init.d/seafile-server
Содержимое:
#!/bin/bash
### BEGIN INIT INFO
# Provides: seafile-server
# Required-Start: $remote_fs $syslog
# 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=haiwen
# Change the value of "seafile_dir" to your path of seafile installation
# usually the home directory of $user
seafile_dir=/data/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 false if fastcgi is not used
fastcgi=true
# 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
Если используете mysql сервер, то замените # Required-Start: $remote_fs $syslog на # Required-Start: $remote_fs $syslog mysql.
Даём права на выполнение скрипта:
sudo chmod +x /etc/init.d/seafile-server
Добавляем seafile-server в rc.d:
sudo update-rc.d seafile-server defaults
Другие Debian-based дистрибутивы
Создаём скрипт seafile-server:
sudo vim /etc/init.d/seafile-server
Содержимое:
#!/bin/sh
### BEGIN INIT INFO
# Provides: seafile-server
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts Seafile Server
# Description: starts Seafile Server
### END INIT INFO
# Change the value of "user" to linux user name who runs seafile
user=haiwen
# Change the value of "seafile_dir" to your path of seafile installation
# usually the home directory of $user
seafile_dir=/data/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=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
Для запуска seahub как fastcgi измените переменную fastcgi на true.
Если используете MySQL, примените «mysql» в строке Required-Start:
# Required-Start: $local_fs $remote_fs $network mysql
Логи:
mkdir /path/to/seafile/dir/logs
Даём права на выполнение скрипта:
sudo chmod +x /etc/init.d/seafile-server
Добавляем seafile-server в rc.d:
sudo update-rc.d seafile-server defaults
Для RHEL/CentOS
Для RHEL/CentOS нужно использовать /etc/rc.local/ скрипты.
Определяем питон (python 2.6 или 2.7):
which python2.6 # or "which python2.7"
В /etc/rc.local, добавляем директорию python2.6(2.7) в PATH, и добавляем seafile/seahub start:
`
# Assume the python 2.6(2.7) executable is in "/usr/local/bin"
PATH=$PATH:/usr/local/bin/
# Change the value of "user" to your linux user name
user=haiwen
# Change the value of "seafile_dir" to your path of seafile installation
# usually the home directory of $user
seafile_dir=/data/haiwen
script_path=${seafile_dir}/seafile-server-latest
sudo -u ${user} ${script_path}/seafile.sh start > /tmp/seafile.init.log 2>&1
sudo -u ${user} ${script_path}/seahub.sh start > /tmp/seahub.init.log 2>&1
Для запуска seahub как fastcgi измените «seahub.sh start» в конце на «seahub.sh start-fastcgi».
Для RHEL/CentOS как сервис
Используем /etc/init.d/ скрипты.
Создаём файл /etc/sysconfig/seafile:
# Change the value of "user" to your linux user name
user=haiwen
# Change the value of "seafile_dir" to your path of seafile installation
# usually the home directory of $user
seafile_dir=/data/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=false
# Set the port of fastcgi, default is 8000. Change it if you need different.
fastcgi_port=8000
Создаём скрипт /etc/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
Создаём скрипт /etc/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
Включаем сервисы:
chmod 550 /etc/init.d/seafile
chmod 550 /etc/init.d/seahub
chkconfig --add seafile
chkconfig --add seahub
chkconfig seahub on
chkconfig seafile on
service seafile start
service seahub start
Содержание
- Creation of initial seafile admin fails #5
- Comments
- http://host:8000 after seafile-admin start #743
- Comments
- It’s the first time you start the seafile server. Now let’s create the admin account
- Successfully created seafile admin
- it is supposed to trig to build all dependencies (including ccnet, libsearpc, and seafile)
- The default install directory is under /usr/local/www/haiwen/
- User have to manually copy linux server version seahub/thirdpart contents because I don’t know whether the
- freebsd port system allows me to hold another tar there
- I also don’t want to deal with every python modules
- make sure that you have the following in the above directory
- You should following the manual book to change path, and config
- You should following the manual book to change path, and config
Creation of initial seafile admin fails #5
When spinning up a fresh container, I receive the following error halfway through the initial setup script:
This is a snippet from the logs. The container starts fine, and I can actually get to the login page, but since the admin account has not been created, I cannot log in.
I’ve been digging through the Seafile codebase to find out where this pops up, and it looks like the check_init_admin.py file is where the exception is thrown, which is called by seahub.sh .
I’m creating the container using the following docker-compose :
There is another reverse proxy in front of this container. I’m assuming this won’t interfere with the admin creation process, but I’m still mentioning it just in case.
By the way: thanks for creating this. It is much, much better than the strange dockerfile wrapper script presented by the Seafile devs themselves.
The text was updated successfully, but these errors were encountered:
Could you give some information on the Docker and Docker-compose versions used?
I have a similar setup in use with an NGINX Reverse proxy and that definitely doesn’t interfer.
This indeed is a strange bug because the Travis Build runs some unit tests and the admin creation is essential for anything to work.
- Is there maybe a permission problem of some sort with the host mount /containers/Seafile ?
- And could you check dmesg / syslog output to problems related to SELinux or other things interfering with docker?
- What happens without the host mount (not persitent of course)?
- EDITED: What distribution do you use?
My Docker host is an Ubuntu server 17.10 machine, with Docker version 17.12.0-ce and Docker-compose version 1.18.0 .
I’ve been testing around some more (also based on your questions). Not mounting the volume still gives the same creation error, so it does not seem to be a permission error on the volume itself. As far as any dmesg logs, there are no things out of the ordinary. I tried looking into some other logging, but Seafile itself does not log a lot regarding the python bootstrap scripts they are providing, so it seems like a dead end there.
However, I found something interesting. Executing the docker run equivalent of my compose file does work. So that would be the following (minus the volume, still for testing purposes):
So this seems to be an issue related to Docker-compose?
This is super weird. To my understanding docker-compose is just wrapper for docker and shouldn’t do any extra stuff. I have docker 1.13 and docker-compose 1.8 , so much older versions than you. I am also using Ubuntu but 16.04.
Could you post the logs of Docker after trying to create the container using docker-compose ? You should be able to get the logs using journalctl -u docker -n 1000 on Ubuntu.
The following is the resulting log of specifically creating the container.
And using docker run :
They seem identical regarding the operations themselves. The moment the creation error pops up, there is no log entry created by Docker.
Could it be a rights issue, that UID and GID need to be passed into the container to properly work when using docker-compose ? I’m guessing here, as it seems to be a longshot.
Just encountered similar with a manual build on Ubuntu 20.04 and Seafile 7.1.5
Starting seahub.sh asks for admin email and password then gives the above error «Error happened during creating seafile admin»
Except in my case I cannot access the site at this point and on server curl 127.0.0.1:8000 returns nothing
Of note I did need to install libmemcached-dev via apt before I could install pylibmc and django-pylibmc via pip3
Источник
http://host:8000 after seafile-admin start #743
I am porting the 3.0.4 to FreeBSD 9.2 Release. I understand that you have no support. Although some ports dependencies are not fully written, the build, installation, and init runs for major components seem fine. I have a question, without setting apache or Ngix, what I should expect to http://host:8000 just after
I hit 500 Internal Server Error, does it mean httpserver has problem? Which log file I can triage what happens.
The text was updated successfully, but these errors were encountered:
It is quite interesting for me to find out that someone installed seafile sucessfully under freebsd.
I believe you forgot execute ./manage.py syncdb in seahub directory before you start seafile. Or you can reference our manual
You might want to turn on django’s debug mode to get more information by adding a line to seahub_setting.py :
PS: I spent some hours compiling seafile under FreeBSD, and only found out I got stuck with libevent2. I referenced some old issues with BSDs support (e.g. haiwen/ccnet#4 ) . I thought it is non-trivial work and I will look into the BSDs support of seafile once I get some free time. And it would be very awesome if you can contribute back to seafile.
I would contribute to a bounty on this. big-grizzly will your work help us get the server running on FreeNAS?
Somehow the above issue is resolved because I know there is something missing for FreeBSD code. Now the important problem in front of me is all the servers are running. But the downloading file size is always 0 byte, although the file size show in main web interface is 200+K bytes. When uploading, connection is always failed.
Yes, if possible, I would like to help FreeBSD, and FreeNAS community to port this project.
big-grizzly, you might want to comment here —> http://forums.pcbsd.org/showthread.php?t=22607
you might get some support, if others know you are working on the project already. I put in a ticket with ixsystems asking them what it would take to get this into FreeNAS.
Hi @big-grizzly @stephenhoos
It sounds coooooooool to get seafile into FreeNAS.
If there is anything I can help with, please don’t hesitate to cc me, or email me rwindz0 AT gmail DOT c0m.
I am not a programmer just a sysadmin, so I can help with testing, but not programming. I run a few FreeNAS boxes, and I can spin up VMs too, so let me know if you need help with testing or anything like that.
big_grizzly, you do not have permission to access this page. This could be due to one of several reasons:
1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else’s post, access administrative features or some other privileged system?
2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
It seems that I hit some issue to post reply.
On Monday, August 11, 2014 10:55 AM, stephenhoos notifications@github.com wrote:
I am not a programmer just a sysadmin, so I can help with testing, but not programming. I run a few FreeNAS boxes, and I can spin up VMs too, so let me know if you need help with testing or anything like that.
—
Reply to this email directly or view it on GitHub.
big_grizzly, where are you having the problem? It looks like your reply
showed up on github
On Wed, Aug 13, 2014 at 3:06 PM, big-grizzly notifications@github.com
wrote:
big_grizzly, you do not have permission to access this page. This could be
due to one of several reasons:
- Your user account may not have sufficient privileges to access this
page. Are you trying to edit someone else’s post, access administrative
features or some other privileged system? - If you are trying to post, the administrator may have disabled your
account, or it may be awaiting activation.
It seems that I hit some issue to post reply.
On Monday, August 11, 2014 10:55 AM, stephenhoos notifications@github.com
wrote:
I am not a programmer just a sysadmin, so I can help with testing, but not
programming. I run a few FreeNAS boxes, and I can spin up VMs too, so let
me know if you need help with testing or anything like that.
—
Reply to this email directly or view it on GitHub.
—
Reply to this email directly or view it on GitHub
#743 (comment).
some patches for FreeBSD(or FreeNAS, untested though)
sadly, seafile (seaf-daemon) requires additional support for fs change watch via kqueue, so building seafile-client (gui) would be quite tough.
Now the major parts work, and libsearpc, and ccnet can pass poudriere in freebsd ports. I am working on finalize sea file ports. There could be small script issue because one script still hangs somewhere.
My working version is on 9.3-release amd64 (the uploading and downloading issues are gone)
On Friday, August 22, 2014 11:13 AM, Chilledheart notifications@github.com wrote:
some patches for FreeBSD(or FreeNAS, untested though)
* ccnet https://github.com/Chilledheart/ccnet/tree/bsd_support
* seafile https://github.com/Chilledheart/seafile/tree/bsd_support
sadly, seafile (seaf-daemon) requires additional support for fs change watch via kqueue, so building seafile-client (gui) would be quite tough.
—
Reply to this email directly or view it on GitHub.
root@freebsd93:/usr/local/www/haiwen/seafile-server # ./seahub.sh restart
Seahub is not running
Starting seahub at port 8000 .
It’s the first time you start the seafile server. Now let’s create the admin account
What is the email for the admin account?
[ admin email ] yan_jingfeng@yahoo.com
What is the password for the admin account?
[ admin password ]
Enter the password again:
[ admin password again ]
Successfully created seafile admin
Loading ccnet config from /usr/local/www/haiwen/ccnet
Loading seafile config from /usr/local/www/haiwen/seafile-data
Seahub is started
Created libevhtp (initial in freebsd already, need some correction), libsearpc, ccnet, sea file, and sea hub ports. Will submit to ports within one-two days.
On Friday, August 22, 2014 11:13 AM, Chilledheart notifications@github.com wrote:
some patches for FreeBSD(or FreeNAS, untested though)
* ccnet https://github.com/Chilledheart/ccnet/tree/bsd_support
* seafile https://github.com/Chilledheart/seafile/tree/bsd_support
sadly, seafile (seaf-daemon) requires additional support for fs change watch via kqueue, so building seafile-client (gui) would be quite tough.
—
Reply to this email directly or view it on GitHub.
bug list 193132,193133,193134,and 193135 to freebsd port tree (libevhtp has been committed, should be 1.2.9_1 soon)
it is supposed to trig to build all dependencies (including ccnet, libsearpc, and seafile)
make install
make clean
The default install directory is under /usr/local/www/haiwen/
User have to manually copy linux server version seahub/thirdpart contents because I don’t know whether the
freebsd port system allows me to hold another tar there
I also don’t want to deal with every python modules
make sure that you have the following in the above directory
[files]
drwxr-xr-x 6 root wheel 25 Aug 28 05:54 wsgidav
drwxr-xr-x 5 root wheel 5 Aug 28 05:54 Djblets-0.6.14.dev-py2.6.egg
drwxr-xr-x 4 root wheel 10 Aug 28 05:54 seafobj.orig
drwxr-xr-x 4 root wheel 4 Aug 28 05:54 gunicorn-0.16.1-py2.6.egg
drwxr-xr-x 4 root wheel 4 Aug 28 05:55 python_daemon-1.5.5-py2.6.egg
drwxr-xr-x 4 root wheel 4 Aug 28 05:55 lockfile-0.9.1-py2.6.egg
drwxr-xr-x 4 root wheel 4 Aug 28 05:55 chardet-2.1.1-py2.6.egg
drwxr-xr-x 4 root wheel 4 Aug 28 05:55 flup-1.0-py2.6.egg
drwxr-xr-x 4 root wheel 4 Aug 28 05:55 Django-1.5.1-py2.6.egg
-rwxr-xr-x 1 root wheel 326 Aug 28 05:55 gunicorn_django
-rw-r—r— 1 root wheel 397 Aug 28 05:55 easy-install.pth
-rwxr-xr-x 1 root wheel 191 Aug 28 05:55 django-admin.py
-rwxr-xr-x 1 root wheel 190 Aug 28 05:55 chardetect.py
-rw-r—r— 1 root wheel 2362 Aug 28 05:55 site.py
-rwxr-xr-x 1 root wheel 343 Aug 28 05:55 seafdav.orig
-rwxr-xr-x 1 root wheel 326 Aug 28 05:55 gunicorn_paster
-rwxr-xr-x 1 root wheel 312 Aug 28 05:55 gunicorn
-rw-r—r— 1 root wheel 1767 Aug 28 05:55 site.pyc
drwxr-xr-x 3 root wheel 5 Aug 28 05:55 six-1.4.1-py2.6.egg
drwxr-xr-x 4 root wheel 21 Aug 28 06:12 rest_framework
drwxr-xr-x 4 root wheel 9 Aug 28 06:12 registration
drwxr-xr-x 4 root wheel 10 Aug 28 06:12 captcha
[files]
mount -t procfs proc /proc
cd /usr/local/www/haiwen/seafile-server/seahub
for file in makemessages.sh.template run-seahub.sh.template send_user_notifications.sh.template setenv.sh.template; do
cp $ $
done
You should following the manual book to change path, and config
source seahub/setenv.sh
./setup-seafile.sh
./seafile.sh start
./seafile.sh stop
On Friday, August 22, 2014 11:13 AM, Chilledheart notifications@github.com wrote:
some patches for FreeBSD(or FreeNAS, untested though)
* ccnet https://github.com/Chilledheart/ccnet/tree/bsd_support
* seafile https://github.com/Chilledheart/seafile/tree/bsd_support
sadly, seafile (seaf-daemon) requires additional support for fs change watch via kqueue, so building seafile-client (gui) would be quite tough.
—
Reply to this email directly or view it on GitHub.
@big-grizzly I am not sure, but you might want to reference the python’s requirements.txt for thirdpart stuff, notably django
and djblets. Perhaps port www/py-django15 and www/py-djblets would fit this gap.
Yeah, I just found them in the freebsd bugzilla. List the links here for convenience :
First of all, I definitely will make try on python module requirement. I think that my original struggling experience with python modules on my 9,2 box is quite bad, especially for django15. The above two modules are still some starts. Gunicorn also make some trouble at that time. Honestly, that 9.2 box has some trouble of python version selection, and some other unclear issue in port mgmt.
Now, I fully work on a new 9.3-rel box, and I will try to fill in the gap as much as possible for sure. The bugs filed in freebsd port tree provide me a baseline that the server side can work on BSD system.
Secondary, I have finished building ccnet 3.1.4, seafile 3.1.4, latest libsearpc now. During the weekend, I will try to make python module into pkg as many as possible.
Finally, I guess turning ports to PBIs should be relatively «easy». Then, stephenhoos can have something tests on PC-BSD.
BTW, libevhtp has fix with bugid 191931 (seafile port needs it), which create shared object by default. It should be in the port tree soon.
On Friday, August 29, 2014 9:56 PM, Chilledheart notifications@github.com wrote:
The port efforts for 3.1.5 has been done, which reach similar situ with porting 3.0.4. I will try to update the bug ids listed in previous post.
Now the steps are simplified to be:
(1) build seahub
(2) mount -t procfs proc /proc
(3)
cd /usr/local/www/haiwen/seafile-server/seahub
for file in makemessages.sh.template run-seahub.sh.template send_user_notifications.sh.template setenv.sh.template; do
cp $ $
done
(4)
cd /usr/local/www/haiwen/seafile-server
You should following the manual book to change path, and config
source seahub/setenv.sh
./setup-seafile.sh
./seafile.sh start
./seahub.sh start
(other detail settings should follow the manual)
There are 2 issues for porting.
(1) requirements.txt
is not part of release 3.1.5, and some of the requirements are not show in 3.1.5 third party packages. For example, pt-selenium. I added it into 3.1.5 port for future reference.
(2) Now the trouble maker is python djblets. The seafile chooses the combination of django and djblets in an interesting way. djblets 0.6.14 requires newer than django 1.1.1, and using django 1.5.1, which fit for the requirement of djblets. System like debian removes djblets package. while FreeBSD has djblets 0.7.28 port. However, the port follows egg requirement strictly, which uses django 1.4.x.
If I want to following normal way to install djblets 0.6.14 by ports, or packages, it will blocks to use existing djblets 0.7.28. I anyway will submit py-djblets06 ports. I don’t prefer to this way.
Let me know if there is any suggestion. Thank you.
Finally, start to work on PBI for PC-BSD.
Best,
Jingfeng
On Saturday, August 30, 2014 2:48 AM, Jingfeng Yan yan_jingfeng@yahoo.com wrote:
First of all, I definitely will make try on python module requirement. I think that my original struggling experience with python modules on my 9,2 box is quite bad, especially for django15. The above two modules are still some starts. Gunicorn also make some trouble at that time. Honestly, that 9.2 box has some trouble of python version selection, and some other unclear issue in port mgmt.
Now, I fully work on a new 9.3-rel box, and I will try to fill in the gap as much as possible for sure. The bugs filed in freebsd port tree provide me a baseline that the server side can work on BSD system.
Secondary, I have finished building ccnet 3.1.4, seafile 3.1.4, latest libsearpc now. During the weekend, I will try to make python module into pkg as many as possible.
Finally, I guess turning ports to PBIs should be relatively «easy». Then, stephenhoos can have something tests on PC-BSD.
BTW, libevhtp has fix with bugid 191931 (seafile port needs it), which create shared object by default. It should be in the port tree soon.
Источник
Seafile — грубо говоря аналог OwnCloud. Только написан на C и Python, что должно быть быстрее PHP и Java. Подробнее см англоязычную вику и там же сравнительную таблицу. А мы будем ставить серверную часть в FreeBSD клетку.
NB. Seafile опирается на СУБД и Web сервер. В качестве СУБД в простейшем варианте используется SQLite. А этот пост про установку с MySQL.
В качестве Web сервера в мануале предлагается настроить Apache или Nginx (сервер gunicorn в настоящее время на FreeBSD не поддерживается). Мне показалось проще настроить Ngnix.
NB. НЕ СПЕШИМ. На момент написания актуальная версия seafile под FreeBSD 6.08. Однако в ней скрипты установки содержат погрешности. Я последние дни тестировал, связывался с разработчиком и он прислал мне исправленные, а заодно и рабочий конфиг Nginx. Архив у меня на Я диске. Выйдет исправленная версия — это примечание уберу.
Seafile с MySQL, установка в FreeBSD jail
1. Создаём клетку, обновляем до актуального состояния, запускаем, смотрим ID командой jls, идём в клетку. Для справки моя версия в момент установки. Ещё раз напомню, я лично предпочитаю под каждую клетку предварительно создать zfs датасет, но это не обязательно.nas4free ~/ root~$ jexec 2 tcsh
root@seafile:/ # uname -a
FreeBSD seafile.local 11.0-RELEASE-p7 FreeBSD 11.0-RELEASE-p7 #0 r312343M: Tue Jan 17 15:41:49 CET 2017 root@dev.nas4free.org:/usr/obj/nas4free/usr/src/sys/NAS4FREE-amd64 amd64
2. Проверяем доступную версию seafileroot@seafile:/ # pkg search seafile-server
seafile-server-6.0.7 Open Source Cloud Storage (Server)
В примере выше сначала система предложит установить pkg.
2.1 Если доступна версия 6.0.7, то советую установить nano (pkg install nano), а затем отредактировать конфигroot@seafile:/ # nano /etc/pkg/FreeBSD.conf
Здесь заменить quarterly на latest, а именно
url: «pkg+http://pkg.FreeBSD.org/${ABI}/quarterly»
на
url: «pkg+http://pkg.FreeBSD.org/${ABI}/latest»
После этого сделать pkg upgrade и вернуться на начало п 2.
2.2 Если доступна версия 6.0.8, то качаем архив по ссылке выше и позже, после установки, заменяем файлы на файлы из архива. Идём к п 3.
2.3 Если 6.0.8_1 — идём к п 3.
3. Установка и настройка MySQL для seafile описана здесь. Вы можете установить MySQL в отдельную клетку и использовать для нескольких применений. Или в ту же, где будет seafile, по вашему выбору. В любом случае для клеток советую для пользователя базы данных IP писать в явном виде, напр seafile@192.168.1.66
А не localhost или %. Создайте три базы данных, как описано, запомните их названия и имя пользователя баз данных.
4 Установка seafileroot@seafile:/ # pkg install seafile-server seahub
5. Запускаем setup
NB если вы качали архив — файл setup-seafile-mysql.py надо взять из него.root@seafile:/ # cd /usr/local/www/haiwen/seafile-server/
root@seafile:/usr/local/www/haiwen/seafile-server # ./setup-seafile-mysql.sh
5.1 Сетап задаст ряд простых вопросов
Имя сервера, IP или доменное имя, куда помещать файлы данных, номер порта.
Имя сервера задайте по вкусу.
На первый тренировочный раз стоит указать IP нашей клетки. Когда будете ставить для доступа снаружи, предварительно сконфигурируйте DDNS или купите доменное имя — эту инфу и вводите. Место под данные сойдёт стандартное, можно всегда отобразить на любую папку хоста через fstab клетки. Порт оставляем по умолчанию.
5.2 Затем сетап спросит о базах данных: «Please choose a way to initialize seafile databases»
Для клетки/jail следует выбрать [2], использовать существующие. Это связано с тем, что по умолчанию localhost в клетках настроен не так, как в хост оси. Далее, отвечая на вопросы скрипта об IP сообщайте адрес клетки в явном виде, напр. 192.168.1.66 (но НЕ пишите localhost, 127.х.х.х и тп)
Затем сообщите скрипту имена трёх баз данных (в моём примере ccnet_db seafile_db seahub_db) и имя/пароль пользователя (в моём примере seafile и Pa$SwORd)
6. Если всё прошло гладко, запускаем seafile. Обратите внимание, что во FreeBSD это делается иначе, чем описано в мануале для Linux.root@seafile:/ # sysrc seafile_enable=YES
seafile_enable: -> YES
root@seafile:/ # sysrc seahub_enable=YES
seahub_enable: -> YES
root@seafile:/ # sysrc seahub_fastcgi=1
seahub_fastcgi: -> 1
root@seafile:/ # service seafile start
root@seafile:/ # service seahub start
7. Если всё гладко — создаём административный аккаунтroot@seafile:/ # cd /usr/local/www/haiwen/seafile-server/
root@seafile:/usr/local/www/haiwen/seafile-server # ./reset-admin.sh
Введите ваш e-mail и пароль доступа к серверу. Забудете — точно также можете поменять.
8. Устанавливаем Nginx (или смотрим в мануал как ставить Апач)root@seafile:/usr/local/www/haiwen/seafile-server # pkg install nginx
root@seafile:/usr/local/www/haiwen/seafile-server # sysrc nginx_enable=YES
nginx_enable: -> YES
9. Конфиг из архива работает для локальной сети и http. Когда будете устанавливать для доступа снаружи — указать доменное имя и настроить https, но это отдельная тема.
Конфиг ngnix /usr/local/etc/nginx/nginx.conf
В нём всё как в Linux мануале, только путь в секции media во FreeBSD по умолчанию другой.location /media {
root /usr/local/www/haiwen/seafile-server-latest/seahub;
}
10. Запускаем ngnixroot@seafile:/ # service nginx start
И идём в браузере по IP нашей клетки.
Вводим логин-пароль из п 7
Можно потыкать.
Настройка https в мануале
Отдельно планирую разбираться с LetsEnscript. Но это потом.
Hi, On a 12.1-RELEASE-p3 with : py37-seafdav-7.1.5 Python library for accessing seafile data model py37-seafobj-7.1.5 Python library for accessing seafile data model seafile-server-7.1.4 Open Source Cloud Storage (Server) seahub-7.1.5 Web frontend for Seafile When i try to start seahub it failed but without any errors : https://paste.swordarmor.fr/BiSX the end : + before_start + prepare_env + [ -z '' ] + echo 'LANG is not set in ENV, set to en_US.UTF-8' LANG is not set in ENV, set to en_US.UTF-8 + export 'LANG=en_US.UTF-8' + [ -z '' ] + echo 'LC_ALL is not set in ENV, set to en_US.UTF-8' LC_ALL is not set in ENV, set to en_US.UTF-8 + export 'LC_ALL=en_US.UTF-8' + export 'CCNET_CONF_DIR=/usr/local/www/haiwen/ccnet' + export 'SEAFILE_CONF_DIR=/usr/local/www/haiwen/seafile-data' + export 'SEAFILE_CENTRAL_CONF_DIR=/usr/local/www/haiwen/conf' + export 'PYTHONPATH=/usr/local/www/haiwen/seafile-server/seafile/lib/python3.7/site-packages:/usr/local/www/haiwen/seafile-server/seafile/lib64/python3.7/site-packages:/usr/local/www/haiwen/seafile-server/seahub/thirdpart:' + export 'SEAHUB_LOG_DIR=/usr/local/www/haiwen/logs' + export 'SEAFILE_RPC_PIPE_PATH=/usr/local/www/haiwen/seafile-server/runtime' + warning_if_seafile_not_running + pgrep -f 'seafile-controller -c /usr/local/www/haiwen/ccnet' + validate_seahub_running + pgrep -f /usr/local/www/haiwen/seafile-server/seahub/manage.py + echo 'Starting seahub at port 8000 ...' Starting seahub at port 8000 ... + su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"' + sleep 5 + pgrep -f seahub.wsgi:application + printf '33[33mError:Seahub failed to start.33[mn' Error:Seahub failed to start. + echo 'Please try to run "./seahub.sh start" again' Please try to run "./seahub.sh start" again + exit 1 If i try to launch seahub.sh : [root@lytan /usr/local/www/haiwen/seafile-server]# bash -x seahub.sh start + echo '' ++ readlink -f seahub.sh + SCRIPT=/usr/local/www/haiwen/seafile-server/seahub.sh ++ dirname /usr/local/www/haiwen/seafile-server/seahub.sh + INSTALLPATH=/usr/local/www/haiwen/seafile-server ++ dirname /usr/local/www/haiwen/seafile-server + TOPDIR=/usr/local/www/haiwen + default_ccnet_conf_dir=/usr/local/www/haiwen/ccnet + default_seafile_data_dir=/usr/local/www/haiwen/seafile-data + central_config_dir=/usr/local/www/haiwen/conf + seafile_rpc_pipe_path=/usr/local/www/haiwen/seafile-server/runtime + manage_py=/usr/local/www/haiwen/seafile-server/seahub/manage.py + gunicorn_conf=/usr/local/www/haiwen/conf/gunicorn.conf.py + pidfile=/usr/local/www/haiwen/pids/seahub.pid + errorlog=/usr/local/www/haiwen/logs/gunicorn_error.log + accesslog=/usr/local/www/haiwen/logs/gunicorn_access.log + gunicorn_exe=/usr/local/www/haiwen/seafile-server/seahub/thirdpart/bin/gunicorn + script_name=seahub.sh + [[ start != start ]] + [[ start == start ]] + [[ 1 == 2 ]] + [[ 1 == 1 ]] + [[ 1 == 2 ]] + port=8000 + case $1 in + start_seahub + before_start + prepare_env + check_python_executable + [[ '' != '' ]] + which python3.7 + PYTHON=python3.7 + validate_ccnet_conf_dir + [[ ! -d /usr/local/www/haiwen/ccnet ]] + validate_seafile_data_dir + [[ ! -d /usr/local/www/haiwen/seafile-data ]] + [[ -z '' ]] + echo 'LANG is not set in ENV, set to en_US.UTF-8' LANG is not set in ENV, set to en_US.UTF-8 + export LANG=en_US.UTF-8 + LANG=en_US.UTF-8 + [[ -z '' ]] + echo 'LC_ALL is not set in ENV, set to en_US.UTF-8' LC_ALL is not set in ENV, set to en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + LC_ALL=en_US.UTF-8 + export CCNET_CONF_DIR=/usr/local/www/haiwen/ccnet + CCNET_CONF_DIR=/usr/local/www/haiwen/ccnet + export SEAFILE_CONF_DIR=/usr/local/www/haiwen/seafile-data + SEAFILE_CONF_DIR=/usr/local/www/haiwen/seafile-data + export SEAFILE_CENTRAL_CONF_DIR=/usr/local/www/haiwen/conf + SEAFILE_CENTRAL_CONF_DIR=/usr/local/www/haiwen/conf + export SEAFILE_RPC_PIPE_PATH=/usr/local/www/haiwen/seafile-server/runtime + SEAFILE_RPC_PIPE_PATH=/usr/local/www/haiwen/seafile-server/runtime + export PYTHONPATH=/usr/local/www/haiwen/seafile-server/seafile/lib/python3.7/site-packages:/usr/local/www/haiwen/seafile-server/seafile/lib64/python3.7/site-packages:/usr/local/www/haiwen/seafile-server/seahub:/usr/local/www/haiwen/seafile-server/seahub/thirdpart: + PYTHONPATH=/usr/local/www/haiwen/seafile-server/seafile/lib/python3.7/site-packages:/usr/local/www/haiwen/seafile-server/seafile/lib64/python3.7/site-packages:/usr/local/www/haiwen/seafile-server/seahub:/usr/local/www/haiwen/seafile-server/seahub/thirdpart: + warning_if_seafile_not_running + pgrep -f 'seafile-controller -c /usr/local/www/haiwen/ccnet' + validate_seahub_running + pgrep -f /usr/local/www/haiwen/seafile-server/seahub/manage.py + pgrep -f seahub.wsgi:application + prepare_seahub_log_dir + logdir=/usr/local/www/haiwen/logs + [[ -d '' ]] + mkdir -p /usr/local/www/haiwen/logs + export SEAHUB_LOG_DIR=/usr/local/www/haiwen/logs + SEAHUB_LOG_DIR=/usr/local/www/haiwen/logs + echo 'Starting seahub at port 8000 ...' Starting seahub at port 8000 ... + check_init_admin + check_init_admin_script=/usr/local/www/haiwen/seafile-server/check_init_admin.py + python3.7 /usr/local/www/haiwen/seafile-server/check_init_admin.py + python3.7 /usr/local/www/haiwen/seafile-server/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /usr/local/www/haiwen/conf/gunicorn.conf.py --preload python3.7: can't open file '/usr/local/www/haiwen/seafile-server/seahub/thirdpart/bin/gunicorn': [Errno 2] No such file or directory + sleep 5 + pgrep -f seahub.wsgi:application + printf '33[33mError:Seahub failed to start.33[mn' Error:Seahub failed to start. + echo 'Please try to run "./seahub.sh start" again' Please try to run "./seahub.sh start" again + exit 1 i try to make a link with the same gunicorn from rc.d script : ln -s /usr/local/bin/gunicorn-3.7 /usr/local/www/haiwen/seafile-server/seahub/thirdpart/gunicorn Nothing change but the link work : [root@lytan /usr/local/www/haiwen/seafile-server]# /usr/local/www/haiwen/seafile-server/seahub/thirdpart/gunicorn usage: gunicorn [OPTIONS] [APP_MODULE] gunicorn: error: No application module specified. gunicorn is correctly installed : [root@lytan /usr/local/www/haiwen/seafile-server]# pkg info | grep gunicorn py37-gunicorn-19.9.0_1 WSGI HTTP Server for UNIX [root@lytan /usr/local/www/haiwen/seafile-server]# find / -name gunicorn /usr/local/lib/python3.7/site-packages/gunicorn /usr/local/bin/gunicorn /usr/local/www/haiwen/seafile-server/seahub/thirdpart/gunicorn In the logs folder, only one file change : ccnet.log [08/02/20 01:25:59] start to serve on pipe client [08/02/20 11:57:12] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 13:36:08] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 13:36:35] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:03] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:04] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:06] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:10] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:12] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:13] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:15] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:17] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:17] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:18] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:20] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:21] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/02/20 15:08:24] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/03/20 17:48:31] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/03/20 21:17:46] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/04/20 12:20:29] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/04/20 12:20:34] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/04/20 12:20:37] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/04/20 13:23:25] ../common/connect-mgr.c(210): [conn] incoming handshake fails. [08/04/20 21:19:09] start to serve on pipe client [08/04/20 21:20:21] ../common/session.c(337): Exit at Tue Aug 4 21:20:21 2020 [08/04/20 21:23:05] ../common/session.c(148): using config file /usr/local/www/haiwen/conf/ccnet.conf [08/04/20 21:23:05] ../common/session.c(268): Update pubinfo file [08/04/20 21:23:05] ../common/connect-mgr.c(515): Opened port 10001 to listen for incoming peer connections [08/04/20 21:23:05] socket file exists, delete it anyway [08/04/20 21:31:02] start to serve on pipe client I upgrade from 7.0 to 7.1 and i use the script in /usr/local/www/haiwen/seafile-server/upgrade/upgrade_7.0_7.1.sh : [root@lytan /usr/local/www/haiwen/seafile-server/upgrade]# ./upgrade_7.0_7.1.sh ------------------------------------------------------------- This script would upgrade your seafile server from 7.0 to 7.1 Press [ENTER] to contiune ------------------------------------------------------------- renaming the gunicorn.conf to gunicorn.conf.py ... Done Updating seafile/seahub database ... [INFO] You are using SQLite3 [INFO] updating seahub database... Traceback (most recent call last): File "/usr/local/www/haiwen/seafile-server/upgrade/db_update_helper.py", line 384, in <module> main() File "/usr/local/www/haiwen/seafile-server/upgrade/db_update_helper.py", line 379, in main db_updater.update_db() File "/usr/local/www/haiwen/seafile-server/upgrade/db_update_helper.py", line 275, in update_db super(SQLiteDBUpdater, self).update_db() File "/usr/local/www/haiwen/seafile-server/upgrade/db_update_helper.py", line 129, in update_db self.update_seahub_sql(seahub_sql) File "/usr/local/www/haiwen/seafile-server/upgrade/db_update_helper.py", line 299, in update_seahub_sql self.apply_sqls(self.seahub_db, sql_path) File "/usr/local/www/haiwen/seafile-server/upgrade/db_update_helper.py", line 289, in apply_sqls conn.execute(line) sqlite3.IntegrityError: UNIQUE constraint failed: constance_config.constance_key Failed to upgrade your database I don't know where to search. Thanks for the help.
Hi, Even with updates, i still have the issue : [root@lytan ~]# /usr/local/etc/rc.d/seahub onestart LANG is not set in ENV, set to en_US.UTF-8 LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... Error:Seahub failed to start. Please try to run "./seahub.sh start" again Packages have been update : [root@lytan ~]# pkg info | grep sea libsearpc-3.2.0_1,1 Simple RPC framework based on GObject System in C py37-seafdav-7.1.6 Python library for accessing seafile data model py37-seafobj-7.1.6 Python library for accessing seafile data model seafile-server-7.1.4 Open Source Cloud Storage (Server) seahub-7.1.5 Web frontend for Seafile If i try the command line in the init script : su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"' I have no return/information in the console. gunicorn.conf.py : import os daemon = True workers = 5 # default localhost:8000 bind = "127.0.0.1:8000" # Pid pids_dir = '/usr/local/www/haiwen/pids' pidfile = os.path.join(pids_dir, 'seahub.pid') # for file upload, we need a longer timeout value (default is only 30s, too short) timeout = 1200 limit_request_line = 8190 Some help will be appreciated! Thanks
Hello Boris,
You should not invoke the seahub.sh startup scripit in the seafile-server folder. Seahub/Seafile is executed under the seafile user and it is possible that invoking it under root will change some of the file permissions.
In order to invoke through cli over service, the command executed is shown when you turned -x on.
> + su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"'
Try to invoke this as root and see if it provides more details.
I also suggest deleting or moving all logs before this so we don't have old entries confusing us.
One other tip, I suggest completely uninstalling seafile/seahub and also doing an pkg autoremove. Look into the folder and check the permissions of everything. ccnet, conf, logs, pids, seafile-data and seahub-data should all be owned by seafile as well as files in these directories.
I'm not currently using sqlite, but sqlite files should also be under seafile. Once this has been checked reinstall seafile/seahub and try starting seafile/seahub again.
I tried the ./seahub.sh because it's in the error message : [root@lytan ~]# /usr/local/etc/rc.d/seahub onerestart Seahub is not running LANG is not set in ENV, set to en_US.UTF-8 LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... Error:Seahub failed to start. Please try to run "./seahub.sh start" again If i try the su method i haven't any return in the console : [root@lytan /usr/local/www/haiwen/logs]# su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"' [root@lytan /usr/local/www/haiwen/logs]# ps aux | grep sea seafile 8619 0.0 0.7 23076 14316 - Ss 20:11 0:00.01 /usr/local/www/haiwen/seafile-server/seafile/bin/seafile-controller -c /usr/local/www/haiwen/ccnet -d /usr/local/www/haiwen/seafile-data -F /usr/l seafile 8620 0.0 1.0 29136 19760 - Ss 20:11 0:00.02 ccnet-server -F /usr/local/www/haiwen/conf -c /usr/local/www/haiwen/ccnet -f /usr/local/www/haiwen/logs/ccnet.log -d -P /usr/local/www/haiwen/pids seafile 8622 0.0 1.2 49948 24276 - Ss 20:11 0:00.03 seaf-server -F /usr/local/www/haiwen/conf -c /usr/local/www/haiwen/ccnet -d /usr/local/www/haiwen/seafile-data -l /usr/local/www/haiwen/logs/seafi root 8666 0.0 0.1 11296 2764 0 S+ 20:13 0:00.00 grep sea i uninstall/remove/reinstall and do "chown -R seafile:seafile /usr/local/www/haiwenn" but nothing change. In the log file seahub.log i have nothing : [root@lytan /usr/local/www/haiwen/logs]# cat seahub.log [root@lytan /usr/local/www/haiwen/logs]# ls -Alrth total 0 -rw-r--r-- 1 seafile seafile 0B Sep 16 20:12 seahub.log
The su method probably doesn't work because it is expecting environment variables which aren't set. Don't worry about this. I don't suggest using this method anyway. Instead, to debug this, in /usr/local/www/haiwen/conf/gunicorn.conf.py change the daemon option to False. Then Invoke service seahub onestart. This should provide stdout and stderr to help solve whatever the issue is starting gunicorn.
Thanks for the help! With daemon to false : [root@lytan ~]# /usr/local/etc/rc.d/seahub onestart LANG is not set in ENV, set to en_US.UTF-8 LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... Traceback (most recent call last): File "/usr/local/bin/gunicorn-3.7", line 11, in <module> load_entry_point('gunicorn==19.9.0', 'console_scripts', 'gunicorn')() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 61, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 223, in run super(Application, self).run() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run Arbiter(self).run() File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 60, in __init__ self.setup(app) File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 120, in setup self.app.wsgi() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load return self.load_wsgiapp() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app __import__(module) File "/usr/local/www/haiwen/seafile-server/seahub/seahub/wsgi.py", line 25, in <module> application = get_wsgi_application() File "/usr/local/lib/python3.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application django.setup(set_prefix=False) File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: bad magic number in 'seahub.group.models': b'x03xf3rn' Error:Seahub failed to start. Please try to run "./seahub.sh start" again
Did you run the upgrade script for 7.0 to 7.1? This should be located in /usr/local/www/haiwen/seafile-server/upgrade/
Yes i use the migration script. Thanks for the help, i will search on the forum!
(In reply to Boris Tassou from comment #8) Hey Boris, Did you ever figure out the issue you were having?
Hi, No, i posted on the seafile forum but no one answer so, i reinstalled with mysql support and not sqlite. I made a backup before reinstall so haven't lost anything.
(In reply to Cédric Chevalier from comment #11) This should be managed by the package, but for safe measure in the future, I will add an install and deinstall action of cleaning up these files.
Thanks for the tip and the fix! |