portfwd ebuild uses /etc/portfwd.cnf instead of the default /etc/portfwd.cfg (see man portfwd), so portfwd doesn't work. There are two possible fixes to this: 1) use portfwd.cfg instead of portfwd.cnf in portfwd.init 2) continue using portfwd.cnf changing portfwd.init as follows: from: start-stop-daemon --start --quiet --exec /usr/sbin/portfwd -- -t -f to: start-stop-daemon --start --quiet --exec /usr/sbin/portfwd -- -t -f -c /etc/portfwd.cnf Reproducible: Always Steps to Reproduce: 1. 2. 3.
moreover the portfwd init script has other errors regarding pid file control. I written a replacement for the start() and stop() functions of the init script and they now works. please review them for ane ventual inclusion in the mainstream init file: start() { checkconfig || return 1 ebegin "Starting portfwd" start-stop-daemon --start --quiet --pidfile /var/run/portfwd.pid --exec /usr/sbin/portfwd -- -t -f _pid="`ps --no-heading -C 'portfwd' -o pid | head -n 1`" if [ -n "$_pid" ] ; then echo "${_pid/ /}" > /var/run/portfwd.pid eend 0 else eend 1 fi } stop() { ebegin "Stopping portfwd" start-stop-daemon --stop --quiet --pidfile /var/run/portfwd.pid if [ $? -eq 0 ]; then rm -f /var/run/portfwd.pid fi eend $? }
more tests, more suggestions: on my machines -t (transparent proxy mode) causes portfwd to misbehave. on others it works fine. I suggest to avoid -f and -t from being hardwires into the init script and to move them a /etc/conf.d/portfwd file as for other daemons.
I've committed all of these fixes in -r1. Please let me know if there are any issues with it; I don't regularly use portfwd. I really appreciate the work you've done on it. Thanks!
okay, just an additional enhancement: the ps command in the init script should be changed : from: `ps --no-heading -C 'portfwd' -o pid | head -n 1` to: `ps -C portfwd -o pid= | head -n 1` bye