[Bug 295110] net/sniproxy: service sniproxy restart does not restart the daemon
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 08 May 2026 20:51:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295110
Bug ID: 295110
Summary: net/sniproxy: service sniproxy restart does not
restart the daemon
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: krion@FreeBSD.org
Reporter: sears@cs.berkeley.edu
Flags: maintainer-feedback?(krion@FreeBSD.org)
Assignee: krion@FreeBSD.org
/etc/rc.d/sniproxy incorrectly specifies a pidfile, but sniproxy doesn't create
one. Therefore, stopping and restarting sniproxy does not work.
This console session shows the problem:
---
# ps uax | grep sniproxy
daemon 48661 0.0 0.0 15512 3284 - I 12:35 0:00.00
/usr/local/sbin/sniproxy -c /usr/local/etc/sniproxy.conf
root 48662 0.0 0.0 15512 3076 - I 12:35 0:00.00
/usr/local/sbin/sniproxy -c /usr/local/etc/sniproxy.conf
root 59212 0.0 0.0 14164 2340 9 S+ 13:34 0:00.00 grep
sniproxy
# service sniproxy restart
sniproxy not running? (check /var/run/sniproxy.pid).
Starting sniproxy.
# ps uax | grep sniproxy
daemon 48661 0.0 0.0 15512 3284 - S 12:35 0:00.00
/usr/local/sbin/sniproxy -c /usr/local/etc/sniproxy.conf
root 48662 0.0 0.0 15512 3076 - I 12:35 0:00.00
/usr/local/sbin/sniproxy -c /usr/local/etc/sniproxy.conf
root 59296 0.0 0.0 14164 2348 9 S+ 13:34 0:00.00 grep
sniproxy
# grep pid /usr/local/etc/rc.d/sniproxy
pidfile=${sniproxy_pidfile:-"/var/run/sniproxy.pid"}
stop_postcmd="rm -f $pidfile"
# ls -l /var/run/sniproxy.pid
ls: /var/run/sniproxy.pid: No such file or directory
---
If I comment out the two lines grep found, then rc will use process name to
decide what to kill + restart:
---
# service sniproxy restart
Stopping sniproxy.
Waiting for PIDS: 48661 48662.
Starting sniproxy.
# ps uax | grep sniproxy
daemon 60022 0.0 0.0 15512 3224 - S 13:38 0:00.00
/usr/local/sbin/sniproxy -c /usr/local/etc/sniproxy.conf
root 60023 0.0 0.0 15512 3076 - S 13:38 0:00.00
/usr/local/sbin/sniproxy -c /usr/local/etc/sniproxy.conf
root 60043 0.0 0.0 14164 2344 9 S+ 13:38 0:00.00 grep
sniproxy
---
Doing this is common practice in other FreeBSD ports, though I guess daemon(8)
could be used to wrap sniproxy and provide pidfiles.
I noticed some other stuff in rc.d/sniproxy that mentions HUP. If that worked
as expected, then restart would reload the configuration files, and I wouldn't
have noticed this issue. It seems likely those lines should be deleted too.
The debian init files in upstream use a pidfile, but they're passing the
pidfile name into their start-stop-daemon tool, which is presumably handling it
on behalf of sniproxy.
--
You are receiving this mail because:
You are the assignee for the bug.