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.servicesh
systemctl edit --full daed.serviceThe 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 aclsh
apt install acl2. 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/letsencryptsh
setfacl -R -m u:nobody:rX /etc/letsencrypt/{live,archive}
setfacl -m u:nobody:rX /etc/letsencrypt3. 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}"