Create a separate dnscrypt system user to start the dnscrypt-proxy.service. ---- Signed-off-by: alive4ever Index: b/dnscrypt-proxy.install =================================================================== --- a/dnscrypt-proxy.install +++ b/dnscrypt-proxy.install @@ -1,7 +1,24 @@ +post_install() { + if ! getent passwd dnscrypt 2>/dev/null >/dev/null; then + printf "Creating dnscrypt system user...\n" && \ + useradd -r -d /var/dnscrypt -m -s /bin/nologin dnscrypt + fi +} post_upgrade() { if [ "$(vercmp $2 1.6.0-2)" -lt 0 ] then echo 'Since 1.6.0-2 the conf.d file is no longer in use. We have enabled systemd support and providing upstream systemd units.' echo 'You will need to use the systemd way (overriding in /etc/systemd/system/dnscrypt-proxy.{service,socket}.d) to apply your customization.' fi + if ! getent passwd dnscrypt 2>/dev/null >/dev/null; then + printf "Creating dnscrypt system user...\n" && \ + useradd -r -d /var/dnscrypt -m -s /bin/nologin dnscrypt + fi +} +post_remove() { + if getent passwd dnscrypt 2>/dev/null >/dev/null; then + printf "Removing dnscrypt system user...\n" && \ + userdel -r dnscrypt 2>/dev/null + fi } +