安装目录

创建 systemd 服务文件 /etc/systemd/system/seafile.service

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 mysql.service

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

[Install]
WantedBy=multi-user.target

创建 systemd 服务文件 /etc/systemd/system/seahub.service

vim /etc/systemd/system/seahub.service
[Unit]
Description=Seafile hub
After=network.target seafile.service

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

[Install]
WantedBy=multi-user.target

设置开机启动项

sudo systemctl enable seafile.service
sudo systemctl enable seahub.service

发表评论

电子邮件地址不会被公开。 必填项已用*标注