-
-
Notifications
You must be signed in to change notification settings - Fork 239
Service installation
Massimo Melina edited this page Aug 22, 2024
·
4 revisions
The process is quite straight-forward and it works on Ubuntu 24.04 LTS:
- Create a new non-privileged user for hfs and create a directory to use as hfs' cwd:
sudo adduser --system hfs
sudo mkdir /var/lib/hfs
- Move HFS deliverable files in system directories:
sudo mv hfs /usr/local/bin/
sudo mv plugins/ /var/lib/hfs/plugins
- Change the owner of
/var/lib/hfs
:
sudo chown hfs:nogroup /var/lib/hfs
- Set capability to hfs executable to open low-numbered ports:
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/hfs
- Create systemd service unit as follows:
[Unit]
Description=HFS
After=network.target
[Service]
Type=simple
User=hfs
Restart=always
ExecStart=/usr/local/bin/hfs --cwd /var/lib/hfs
[Install]
WantedBy=multi-user.target
- run
sudo systemctl daemon-reload && sudo systemctl enable hfs && sudo systemctl start hfs && sudo systemctl status hfs