Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 33994 - portfwd ebuild error
Summary: portfwd ebuild error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jon Portnoy (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-21 00:39 UTC by Alessandro Pisani
Modified: 2003-12-11 05:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Pisani 2003-11-21 00:39:47 UTC
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.
Comment 1 Alessandro Pisani 2003-11-21 01:15:56 UTC
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 $?
}
Comment 2 Alessandro Pisani 2003-11-21 02:16:32 UTC
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.
Comment 3 Jon Portnoy (RETIRED) gentoo-dev 2003-12-03 13:19:37 UTC
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!
Comment 4 Alessandro Pisani 2003-12-11 05:10:30 UTC
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