Skip to content

Services & certificates ​

Customize a systemd service ​

Edit the systemd service file with systemctl edit --full. This example edits daed.service:

sh
sudo systemctl edit --full daed.service
sh
systemctl edit --full daed.service

The edited file is saved as /etc/systemd/system/daed.service, not /lib/systemd/system/daed.service. Package updates do not overwrite it.

Let a non-root user read Let's Encrypt certificates ​

The v2ray, xray, juicity and juicity-rs services run as nobody. This user cannot read certificates in /etc/letsencrypt/live by default. Set access control lists (ACLs) to grant read access.

1. Install acl on Debian or Ubuntu ​

sh
sudo apt install acl
sh
apt install acl

2. Grant nobody access to the certificates ​

sh
sudo setfacl -R -m u:nobody:rX /etc/letsencrypt/{live,archive}
sudo setfacl -m u:nobody:rX /etc/letsencrypt
sh
setfacl -R -m u:nobody:rX /etc/letsencrypt/{live,archive}
setfacl -m u:nobody:rX /etc/letsencrypt

3. Set a Certbot deploy hook to restore ACLs after renewal ​

sh
sudo certbot renew --deploy-hook "setfacl -R -m u:nobody:rX /etc/letsencrypt/{live,archive}"
sh
certbot renew --deploy-hook "setfacl -R -m u:nobody:rX /etc/letsencrypt/{live,archive}"