Bug 221203 - rc.subr fails to recognize daemons using interpreters when they use setproctitle
Summary: rc.subr fails to recognize daemons using interpreters when they use setproctitle
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 10.3-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-rc mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-08-03 14:44 UTC by Mathieu Arnold
Modified: 2017-08-09 19:49 UTC (History)
1 user (show)

See Also:


Attachments
v1 (493 bytes, patch)
2017-08-03 14:44 UTC, Mathieu Arnold
no flags Details | Diff
v1bis (942 bytes, patch)
2017-08-03 14:45 UTC, Mathieu Arnold
no flags Details | Diff
v2bis (1.25 KB, patch)
2017-08-03 14:51 UTC, Mathieu Arnold
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer 2017-08-03 14:44:39 UTC
Created attachment 184994 [details]
v1

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]
v1bis

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]
v2bis

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.