Page MenuHomeFreeBSD

rc: add a manual entry for ${name}_setup
ClosedPublic

Authored by franco_opnsense.org on Aug 16 2022, 8:09 AM.
Tags
Referenced Files
Unknown Object (File)
Wed, May 1, 2:22 AM
Unknown Object (File)
Fri, Apr 26, 6:45 PM
Unknown Object (File)
Apr 8 2024, 4:44 PM
Unknown Object (File)
Mar 31 2024, 1:11 PM
Unknown Object (File)
Mar 1 2024, 12:29 AM
Unknown Object (File)
Feb 1 2024, 2:05 AM
Unknown Object (File)
Jan 1 2024, 6:18 AM
Unknown Object (File)
Dec 20 2023, 4:46 AM

Details

Summary

${name}_prepend is suboptimal as it is prepended to the actual
command being run. Therefore the term "commandS to prepend"
is misleading and no clear separation takes place for setup tasks
that may be required like changing a config file permission or
generating a configuration file prior to service start.

The other reason is that {argument}_precmd is a service-side
variable and cannot be repurposed from the user-side.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

English LGTM and the addition of ${name}_setup looks consistent with https://reviews.freebsd.org/D36006 to my untrained eye. I can't say whether the change to ${name}_prepend is correct.

This revision is now accepted and ready to land.Aug 17 2022, 7:34 AM
0mp requested changes to this revision.Aug 17 2022, 1:33 PM
0mp added a subscriber: 0mp.

"Commands" is correct because it can be a complete sh "pipeline" consisting of many commands (see the Pipeline subsection in sh(1) for details).

Otherwise, it seems ok. Although I'm not 100% happy with the whole change. I'll comment on the original patch on the dev-commits-src-main@ mailing list.

This revision now requires changes to proceed.Aug 17 2022, 1:33 PM

I reverted the change in question although I don't agree with the rationale. NAME_prepend remains a fragile construct, not being used in visible code in ports/src and prepending command(s) would imply that either ";" or "&&" is being used by default to separate the argument, which the user will not know because the documentation is not complete or the concept involved is not well-designed.

The ${name}_prepend caveat no longer applies.

@0mp are you happy with the fixed version?

This revision was not accepted when it landed; it landed in state Needs Review.Nov 11 2022, 9:24 PM
This revision was automatically updated to reflect the committed changes.