Настроим автозапуск сервера Seafile при загрузке системы.
https://download.seafile.com/published/seafile-manual/deploy/start_seafile_at_system_bootup.md
Для systemd
Debian 8 и старше, Linux Ubuntu 15.04 и старше
${seafile_dir} — измените переменную на путь к вашей директории Seafilr.
Работаем под рутом. Создаём сервис 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=forking
# 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
Запускаем сервисы и настраиваем автозагрузку:
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
Источник:
https://internet-lab.ru/seafile_start_at_system_boot
Если вам понравилась статья, то ставьте 👍🏻 каналу. Пишите комментарии, задавайте вопросы, подписывайтесь.