mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #159] suggestion for Debian 11 Systemd Service #77
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @laminux29 on GitHub (Dec 23, 2022).
Original GitHub issue: https://github.com/sigoden/dufs/issues/159
Tested for debian 11
Please loggin as root
1.Create folder for www datas
mkdir -p /www_dufs
2.Create folder for certs
mkdir -p /www_dufs_certsOnly
3.Write a starup script
echo "dufs /www_dufs/ --bind 0.0.0.0 --port 443 --allow-search --enable-cors --tls-key /www_dufs_certsOnly/xx.key --tls-cert /www_dufs_certsOnly/xx.cert >> /var/log/dufs.log" > /startDufs.sh
chmod ugo+rwx /startDufs.sh
4.Write systemd service
tee /etc/systemd/system/dufs.service <<-"EOF"
[Unit]
Description=dufs
After=network.target auditd.service
[Service]
ExecStart=sh /startDufs.sh
[Install]
WantedBy=multi-user.target
EOF
chmod ugo+wrx /etc/systemd/system/dufs.service
systemctl daemon-reload
systemctl enable dufs.service
5.reboot, then dufs service will auto startup on boot.
shutdown -r now
6.Check log:
tail -f /var/log/dufs.log
7.Alive check:
netstat -nlap | grep "LISTEN" | grep ":443"
8.Control Dufs Service:
systemctl status dufs
systemctl start dufs
systemctl restart dufs
@sigoden commented on GitHub (Feb 19, 2023):
Thanks for sharing.
@SantaLaMuerte commented on GitHub (Mar 10, 2024):
maybe it can be installed as service ? to run with args like systemctl start dufs -A - by default install with cargo?
? it will be very helpfull