On Thu, August 6, 2020 9:12 pm, Thomas Levine wrote:
> The present patch changes the rc.subr(8) manual page to match
> the implementation.
>
> The current manual page for rc.subr(8) says that $pexp is "A regular
> expression to be passed to pgrep(1) in order to find the desired process
> or to be passed to pkill(1) to stop it."
>
> The file /etc/rc.d/rc.subr currently uses $pexp only as a fixed
> expression, with the -xf flags.
>
> > grep pexp /etc/rc.d/rc.subr
> pexp=${pexp}
> multicast nfs_server pexp pf pkg_scripts shlib_dirs spamd_black
> pgrep -T "${daemon_rtable}" -q -xf "${pexp}"
> pkill -HUP -T "${daemon_rtable}" -xf "${pexp}"
> pkill -T "${daemon_rtable}" -xf "${pexp}"
> # make sure pexp matches the process (i.e. doesn't include the quotes)
> pexp="$(eval echo ${daemon}${daemon_flags:+ ${daemon_flags}})"
>
> The -xf flags are explained in the pgrep(1) and pkill(1) man page.
>
> -x Require an exact match of the process name, or argument
> list if -f is given. The default is to match any substring.
>
> The present patch replaces instances of "regular expression" with
> "fixed expression".
>
I'm not sure what you mean by a "fixed expression". A string? But reread
the pgrep/pkill manpage. They take a pattern as an operand which is
described to be an extended regular expression.
This is true. Even with -x.
Try it.