Subject: Re: misc/35366
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Hubert Feyrer <hubert@feyrer.de>
List: netbsd-bugs
Date: 01/19/2007 12:25:01
The following reply was made to PR misc/35366; it has been noted by GNATS.
From: Hubert Feyrer <hubert@feyrer.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: misc/35366
Date: Fri, 19 Jan 2007 13:20:27 +0100 (CET)
2nd try to get this into gnats... - HF
---------- Forwarded message ----------
Date: Fri, 19 Jan 2007 01:10:27 +0100 (CET)
From: Hubert Feyrer <hubert@feyrer.de>
To: Dominik Joe Pantucek <joe@joe.cz>
Cc: gnats-bugs@NetBSD.org, he@NetBSD.org, Hubert Feyrer <hubert@feyrer.de>
Subject: Re: PR misc/35366
[CC:ing he@ for rev. 1.66 of rc.subr & PR 31932]
Hi,
following up our chat on IRC tonight, I'm sending you this mail to document the
latest state of things, also in the PR (hopefully...).
Citing you from IRC:
<dzoe> But it is the same as the cas 1.66 addresses
<dzoe> But not for interpreter, but for the interpreted program itselft.
<dzoe> /path/to/interp /path/to/program
<dzoe> /path/to/interp program
<dzoe> interp /path/to/program
<dzoe> interp program
<dzoe> 1.66 handles first 3 cases
<dzoe> Why not the fourth, especially when the 4th is only a variation on 3rd.
<dzoe> 1.66 catches the "perl: bla" case as long as bla=/path/to/program
rev. 1.66 was in response to PR 31932, it documents postgrey running as
476 ? IWs 0:41.25 perl: /usr/pkg/sbin/postgrey -i 2525 -d
--pidfile=/var/run/postgrey.pid (perl)
while for amavis this is something like:
16541 ? S<s 0:06.44 perl: amavisd (master)
so the difference is to either match a full or short pathname in the _proccheck
variable, after the interpreter and the ": ". The patch below is also available
from http://www.feyrer.de/Misc/pr-35366-patch4, please test and let me know if
it improves the situation for you.
- Hubert
--- /usr/cvs/src-current/etc/rc.subr 2007-01-18 22:24:25.000000000 +0100
+++ /etc/rc.subr 2007-01-19 01:07:44.000000000 +0100
@@ -179,6 +179,7 @@
_psargs=$3
_pref=
+ _procnamebn=${_procname##*/}
if [ $_interpreter != "." ]; then # an interpreted script
read _interp < ${_chroot:-}/$_procname # read interpreter name
_interp=${_interp#\#!} # strip #!
@@ -190,9 +191,8 @@
_interpbn=${1##*/}
_fp_args='_argv'
_fp_match='case "$_argv" in
- ${_interp}|"${_interp} "*|"${_interpbn}: ${_procname}"*)'
+ ${_interp}|"${_interp} "*|"${_interpbn}:
"*${_procnamebn}*)'
else # a normal daemon
- _procnamebn=${_procname##*/}
_fp_args='_arg0 _argv'
_fp_match='case "$_arg0" in
$_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})")'