Date: Fri, 16 Sep 2005 16:16:27 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: Andy Hilker <ah@crypta.net> Cc: freebsd-stable@freebsd.org Subject: Re: rc-ng problem with [procname] (e.g. kernel threaded procs) Message-ID: <20050916141627.GA37203@stack.nl> In-Reply-To: <20050816172441.GD36329@mail.crypta.net> References: <20050812104352.GD2637@mail.crypta.net> <20050816172441.GD36329@mail.crypta.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 16, 2005 at 07:24:41PM +0200, Andy Hilker wrote: > Hmh, no one interested in this issue? Or am i wrong with this issue? Apparently noone is interested. Be sure to file a PR if you haven't done so yet. > You (Andy Hilker) wrote: > > i think I have found a problem with rc-ng scripts and procnames > > including brackets (e.g. kernel threaded, like mysqld). > > Brackets [] are ignored, process will not be found and is regarded > > as "not running". This breaks stop+status functions of rcng. The > > following patch allows brackets in variable procname rc-ng scripts. > > Maybe someone can review and fix this issue. > > It was relevant for me when using [mysqld]. This happens if the argv is larger than kern.ps_arg_cache_limit and either /proc is not mounted or the user running ps is not allowed to read the command's memory. Your patch needs \[, \] by the way, not ( ). Alternatively, you could use ps -o pid,ucomm for the $_interpreter = . case and only look for $_procnamebn. This whole ps stuff has the potential of killing the wrong process, how about using pidfiles? > > # $FreeBSD: src/etc/rc.subr,v 1.31.2.1 2005/01/17 11:51:00 keramida Exp $ > > --- rc.subr Thu Aug 11 15:18:52 2005 > > +++ /etc/rc.subr Thu Aug 11 15:14:06 2005 > > @@ -267,7 +267,7 @@ > > _procnamebn=${_procname##*/} > > _fp_args='_arg0 _argv' > > _fp_match='case "$_arg0" in > > - $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})")' > > + "$_procname"|$_procnamebn|${_procnamebn}:|"(${_procnamebn})")' > > fi > > > > _proccheck=' -- Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050916141627.GA37203>