Bug 221203

Summary: rc.subr fails to recognize daemons using interpreters when they use setproctitle
Product: Base System Reporter: Mathieu Arnold <mat>
Component: confAssignee: freebsd-rc (Nobody) <rc>
Status: Open ---    
Severity: Affects Many People CC: jilles
Priority: --- Keywords: patch
Version: 10.3-RELEASE   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221000
Description Flags
v2bis none

Description Mathieu Arnold freebsd_committer 2017-08-03 14:44:39 UTC
Created attachment 184994 [details]

Some daemon runs, say, with:

/usr/local/bin/perl -wT /usr/local/share/munin/munin-asyncd

And for the few first milliseconds, `ps -ww -o pid= -o jid= -o command=` that rc.subr uses will return that as the command, and then, it starts working, and then, the command ends up being:

munin-asyncd [aragorn.in.absolight.net] [idle] (perl)

So, here is a patch that will support "<command_name>*(<interp>)"
Comment 1 Mathieu Arnold freebsd_committer 2017-08-03 14:45:20 UTC
Created attachment 184995 [details]

And here is a patch that adds a new variable to add to the glob code.
Comment 2 Mathieu Arnold freebsd_committer 2017-08-03 14:51:31 UTC
Created attachment 184996 [details]

Fixup the alternative patch.
Comment 3 Jilles Tjoelker freebsd_committer 2017-08-09 19:49:26 UTC
Patch v1 seems sensible. Patch v2bis looks like it will not work (the | is literal, e.g. sh -c 'case "a|b" in a${$+|b}) echo yes;; esac' prints yes) and the extra complexity is probably unnecessary.