-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
brew audit: allow require_root
to exist independent of run
in service do blocks
#16908
Comments
@Jerry1144 Sorry, I'm not sure what's being asked for here so have a few questions.
Why do you not want to add a Maybe it's worth providing some more examples about what:
Thanks! |
@MikeMcQuaid Briefly,
Audit rules currently does not allow anything other than I believe the audit rules was there so that we authors don't accidentally mix the two uses - supplying However,
I feel these are off-topic, but
|
so, if I've understood correctly: you want to use an upstream-provided |
Yes, to instruct users that by default they should be run as root, because maybe the tool talks with SMC and those syscall only work as root. it feels awkward to paraphrase the whole plist in the formula when there's already one in place. I understand it may pose a security risk if upstream changes plist contents someday, but the guidelines aren't very clear about the Maintainer's position on this (if run as root, always paraphrase the plist, so formula reviewers can quickly check if it's sane). |
This is reasonable and the only reason we haven't added it is because no one has mentioned until now. |
Thank you! I took the liberty to expand the Service block methods section in Formula Cookbook a little. Jerry1144@4a0e648 Should I open a PR for it? I clicked Fork and Commit, why does this commit 4a0e648 exist in this repository too 😯 |
A PR would be great, thanks! |
Verification
brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.Provide a detailed description of the proposed feature
Cross-post from Homebrew/homebrew-services#636. I propose that audit rules allow require_root to exist with
name
and withoutrun
. I.e. make suchservice do
legal:brew audit
currently complains that run must be defined to use methods other than name like [:require_root].If I removed the require_root line, I'd have to write my own Caveat, asking users to ignore the subsequent non-sudo brew services start line. How weird would that sound!
What is the motivation for the feature?
I find name+require_root perfect in "tool provides a system Daemon, and a ready-made plist to be put into /Library/LaunchDaemons". It makes brew output the right command to run in the Caveats section:
and it Just Works.
How will the feature be relevant to at least 90% of Homebrew users?
Hardly. Not many formulae provide a service, and fewer a LaunchDaemon that must run as root, and even fewer a launchd.plist as part of the installation. Still, for those formulae that do, it will make life easier to write a service-do and get it merged.
What alternatives to the feature have been considered?
Manually construct the service file, filling the
run
,RunAtLoad
, etc. in service do, just to please the auditor. Guidelines suggest I use the provided plist if a tool comes with one, and only make one myself when it doesn't.Also, service do block written that way appends this misleading latter half of a Caveat, ugh:
but I guess that's a separate issue.
The text was updated successfully, but these errors were encountered: