Patch for /etc/rc.subr
--000325559fded5072d048ddac954
Content-Type: text/plain; charset=ISO-8859-1
Hi,
below is a patch that allows correct behaviour of the use of
command_interpreter in rc.d
scripts in some cases where the proctitle of ps doesn't include the full
interpreter path,
but for example just "perl: ..." (instead of "/usr/pkg/bin/perl -flags
....").
I tried to use the mail/postgrey greylisting server, but the
/etc/rc.d/postgrey stop/status
didn't worked due to that. With this patch, it works!
Regards,
Michael
root@kvmdragon:~# diff -u /usr/src/etc/rc.subr /etc/rc.subr
--- /usr/src/etc/rc.subr 2010-08-11 16:44:59 +0200
+++ /etc/rc.subr 2010-08-15 13:05:37 +0200
@@ -359,9 +359,10 @@
warn "\$command_interpreter $_interpreter != $1"
fi
_interp="$* $_procname" # cleanup spaces, add _procname
+ _interpbn="$1" # the interpreter binary
_fp_args='_argv'
_fp_match='case "$_argv" in
- ${_interp}|"${_interp} "*)'
+ "${_interpbn##*/}: "$_procname*|${_interp}|"${_interp} "*)'
else # a normal daemon
_procnamebn=${_procname##*/}
_fp_args='_arg0 _argv'
--000325559fded5072d048ddac954
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,<br><br>below is a patch that allows correct behaviour of the use of com=
mand_interpreter in rc.d<br>scripts in some cases where the proctitle of ps=
doesn't include the full interpreter path,<br>but for example just &qu=
ot;perl: ..." (instead of "/usr/pkg/bin/perl -flags ...").<b=
r>
<br>I tried to use the mail/postgrey greylisting server, but the /etc/rc.d/=
postgrey stop/status=A0 <br>didn't worked due to that. With this patch,=
it works!<br><br>Regards,<br><br>=A0 Michael<br><br>root@kvmdragon:~# diff=
-u /usr/src/etc/rc.subr /etc/rc.subr<br>
--- /usr/src/etc/rc.subr=A0=A0=A0 2010-08-11 16:44:59 +0200<br>+++ /etc/rc.=
subr=A0=A0=A0 2010-08-15 13:05:37 +0200<br>@@ -359,9 +359,10 @@<br>=A0=A0=
=A0=A0 =A0=A0=A0 =A0=A0=A0 warn "\$command_interpreter $_interpreter !=
=3D $1"<br>=A0=A0=A0=A0 =A0=A0=A0 fi<br>=A0=A0=A0=A0 =A0=A0=A0 _interp=
=3D"$* $_procname"=A0=A0=A0 =A0=A0=A0 # cleanup spaces, add _proc=
name<br>
+=A0=A0=A0 =A0=A0=A0 _interpbn=3D"$1"=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 # the interpreter binary<br>=A0=A0=
=A0=A0 =A0=A0=A0 _fp_args=3D'_argv'<br>=A0=A0=A0=A0 =A0=A0=A0 _fp_m=
atch=3D'case "$_argv" in<br>-=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 ${=
_interp}|"${_interp} "*)'<br>
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 "${_interpbn##*/}: "$_procname*|${=
_interp}|"${_interp} "*)'<br>=A0=A0=A0=A0 else=A0=A0=A0 =A0=
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 # a normal daemon<br>=A0=A0=A0=A0 =A0=
=A0=A0 _procnamebn=3D${_procname##*/}<br>=A0=A0=A0=A0 =A0=A0=A0 _fp_args=3D=
'_arg0 _argv'<br>
<br>
--000325559fded5072d048ddac954--