Bug 295056 - dns/dnscrypt-proxy2: restart not working
Summary: dns/dnscrypt-proxy2: restart not working
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Vinícius Zavam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-06 13:59 UTC by Franz Schwartau
Modified: 2026-06-23 21:56 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (egypcio)


Attachments
diff for adding stop_postcmd to /usr/local/etc/rc.d/dnscrypt-proxy (675 bytes, text/plain)
2026-05-06 13:59 UTC, Franz Schwartau
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franz Schwartau 2026-05-06 13:59:49 UTC
Created attachment 270463 [details]
diff for adding stop_postcmd to /usr/local/etc/rc.d/dnscrypt-proxy

After upgrading from FreeBSD 13.5 to 14.4, dnscrypt-proxy can no longer be restarted with the provided rc.d script:

# /usr/local/etc/rc.d/dnscrypt-proxy restart
Stopping dnscrypt_proxy.
Waiting for PIDS: 34728.
dnscrypt_proxy already running?  (pid=34728).

Stopping dnscrypt-proxy leaves the pid file in the filesystem for a moment:

/usr/local/etc/rc.d/dnscrypt-proxy stop ; ls -l /var/run/dnscrypt-proxy.pid ; sleep 1 ; ls -l /var/run/dnscrypt-proxy.pid
Stopping dnscrypt_proxy.
Waiting for PIDS: 96079.
-rw-------  1 root wheel 5 May  6 15:40 /var/run/dnscrypt-proxy.pid
ls: /var/run/dnscrypt-proxy.pid: No such file or directory

The issue appears to be caused by a change in wait_for_pids() in /etc/rc.subr. On FreeBSD 13.5 there was a sleep 1 included which is missing in FreeBSD 14.4's rc.subr.

I added a stop_postcmd to /usr/local/etc/rc.d/dnscrypt-proxy to wait the pid file to disappear. Please see the attached diff.