Patch for /etc/rc.subr

看板DFBSD_submit作者時間15年前 (2010/08/15 19:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
--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&#39;t include the full interpreter path,<br>but for example just &qu= ot;perl: ...&quot; (instead of &quot;/usr/pkg/bin/perl -flags ...&quot;).<b= r> <br>I tried to use the mail/postgrey greylisting server, but the /etc/rc.d/= postgrey stop/status=A0 <br>didn&#39;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 &quot;\$command_interpreter $_interpreter != =3D $1&quot;<br>=A0=A0=A0=A0 =A0=A0=A0 fi<br>=A0=A0=A0=A0 =A0=A0=A0 _interp= =3D&quot;$* $_procname&quot;=A0=A0=A0 =A0=A0=A0 # cleanup spaces, add _proc= name<br> +=A0=A0=A0 =A0=A0=A0 _interpbn=3D&quot;$1&quot;=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&#39;_argv&#39;<br>=A0=A0=A0=A0 =A0=A0=A0 _fp_m= atch=3D&#39;case &quot;$_argv&quot; in<br>-=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 ${= _interp}|&quot;${_interp} &quot;*)&#39;<br> +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 &quot;${_interpbn##*/}: &quot;$_procname*|${= _interp}|&quot;${_interp} &quot;*)&#39;<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= &#39;_arg0 _argv&#39;<br> <br> --000325559fded5072d048ddac954--
文章代碼(AID): #1CPz0uBZ (DFBSD_submit)