Date: Wed, 17 Aug 2022 15:33:54 +0200
From: Mateusz Piotrowski <0mp@FreeBSD.org>
To: Mariusz Zaborski <oshogbo@freebsd.org>, franco@opnsense.org
Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject: Re: git: c9be47b34dd8 - main - rc: add ${name}_setup script support
Message-ID: <D086BBF9-F211-447E-8C55-EBDBCF0B3E9B@FreeBSD.org>
In-Reply-To: <202208151442.27FEgjSd083060@gitrepo.freebsd.org>
References: <202208151442.27FEgjSd083060@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hey, > On 15. Aug 2022, at 16:42, Mariusz Zaborski <oshogbo@freebsd.org> wrote: > > The branch main has been updated by oshogbo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c9be47b34dd847da1d4ab0feee4a6100b2c5ea0d > > commit c9be47b34dd847da1d4ab0feee4a6100b2c5ea0d > Author: Franco Fichtner <franco@opnsense.org> > AuthorDate: 2022-08-15 14:41:31 +0000 > Commit: Mariusz Zaborski <oshogbo@FreeBSD.org> > CommitDate: 2022-08-15 14:43:12 +0000 > > rc: add ${name}_setup script support > > Run a service-based setup script before running the start command. > Useful for automatic configuration file generation. > Couldn't this be achieved with NAME_prepend? Here’s an example: # sh -c 'test_prepend="/bin/echo \"generating files\" &&”; . /etc/rc.subr; name=test; rcvar=test_enable; command="/bin/echo”; command_args="hello”; run_rc_command onestart’ The out will be: Starting test. generating files hello Best, Mateusz [-- Attachment #2 --] <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hey,<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 15. Aug 2022, at 16:42, Mariusz Zaborski <<a href="mailto:oshogbo@freebsd.org" class="">oshogbo@freebsd.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">The branch main has been updated by oshogbo:<br class=""><br class="">URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=c9be47b34dd847da1d4ab0feee4a6100b2c5ea0d" class="">https://cgit.FreeBSD.org/src/commit/?id=c9be47b34dd847da1d4ab0feee4a6100b2c5ea0d</a><br class=""><br class="">commit c9be47b34dd847da1d4ab0feee4a6100b2c5ea0d<br class="">Author: Franco Fichtner <<a href="mailto:franco@opnsense.org" class="">franco@opnsense.org</a>><br class="">AuthorDate: 2022-08-15 14:41:31 +0000<br class="">Commit: Mariusz Zaborski <<a href="mailto:oshogbo@FreeBSD.org" class="">oshogbo@FreeBSD.org</a>><br class="">CommitDate: 2022-08-15 14:43:12 +0000<br class=""><br class=""> rc: add ${name}_setup script support<br class=""><br class=""> Run a service-based setup script before running the start command.<br class=""> Useful for automatic configuration file generation.<br class=""><br class=""></div></div></blockquote><div><br class=""></div>Couldn't this be achieved with NAME_prepend? Here’s an example:</div><div><br class=""></div><div><br class=""></div><div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class=""># sh -c 'test_prepend="/bin/echo \"generating files\" &&”; </div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">. /etc/rc.subr; name=test; </div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">rcvar=test_enable; </div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">command="/bin/echo”; </div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">command_args="hello”; </div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">run_rc_command onestart’</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">The out will be:</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">Starting test.</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">generating files</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">hello</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">Best,</div><div style="margin: 0px; font-stretch: normal; font-size: 13px; line-height: normal; font-family: "Helvetica Neue";" class="">Mateusz</div></div></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D086BBF9-F211-447E-8C55-EBDBCF0B3E9B>
