Summary: | rc_startmsgs: Silence "Starting ..." messages | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Jose Luis Duran <jlduran> | ||||||||||
Component: | conf | Assignee: | Mateusz Piotrowski <0mp> | ||||||||||
Status: | Closed FIXED | ||||||||||||
Severity: | Affects Only Me | CC: | 0mp, imp, lwhsu, rgrimes | ||||||||||
Priority: | --- | ||||||||||||
Version: | CURRENT | ||||||||||||
Hardware: | Any | ||||||||||||
OS: | Any | ||||||||||||
Attachments: |
|
This fixes one of many cases. A quick grep of /etc/rc.d indicates that at least jail, local, ppp, pppoed and rfcomm_pppd_server may also be ignoring the rc_startmsgs control. Created attachment 224275 [details]
Address @rgrimes suggestions
There is another case, /etc/network.subr invokes wpa_supplicant/hostapd start, and the message "Starting wpa_supplicant." is displayed. I don't know how to best address this one.
Thank you!
Created attachment 224278 [details]
Start with the easy ones first.
The previous patch was wrong.
Created attachment 224281 [details]
Easy fixes first.
This is an interesting patch. I believe we should get it committed in some form. I'd be tempted to create a startmsg (to pick a name) that's basically "check_startmsg && echo" and use it everywhere. That way we don't need to have if we're doing the messages or not statements which are copying code into two places which strikes me as unwise. (In reply to Warner Losh from comment #6) Sure, I think it would be a welcomed addition to rc.subr. That way it could handle echo's "-n" flag for cases like jails: "Starting jails: jail1 jail2 jailn." and avoid the ifs. I originally decided to close this PR as incomplete, since there is no `rc_stopmsgs`, hence some "Stopping ..." messages will still be displayed. (In reply to Warner Losh from comment #6) Not holding my breath on this one, but it is up for review just in case: https://reviews.freebsd.org/D34513 https://reviews.freebsd.org/D34514 Thank you! A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=19a6267d61a0c3bd6cd56f19ca3f8a67a54f675c commit 19a6267d61a0c3bd6cd56f19ca3f8a67a54f675c Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2022-03-13 17:54:39 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-03-13 17:57:31 +0000 rc.d/*: Use startmsg instead of echo on start messages By rc.conf(5), setting rc_startmsgs="NO" should silence start messages. Fix a few rc scripts by using startmsg. PR: 255207 Reported by: Jose Luis Duran <jlduran@gmail.com> Reviewed by: imp, 0mp Approved by: imp (src) Differential Revision: https://reviews.freebsd.org/D34514 libexec/rc/rc.d/jail | 16 ++++++++-------- libexec/rc/rc.d/local | 4 ++-- libexec/rc/rc.d/netif | 2 +- libexec/rc/rc.d/ppp | 6 +++--- libexec/rc/rc.d/pppoed | 2 +- libexec/rc/rc.d/rfcomm_pppd_server | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=325ebf37d8efc6488754051fcc2b1aaa40cefd8b commit 325ebf37d8efc6488754051fcc2b1aaa40cefd8b Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2022-03-13 17:48:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-03-13 17:57:29 +0000 Introduce startmsg and use it in rc scripts startmsg is a new rc.subr(8) function function to be used instead of echo(1) when for boot messages. It replaces the often forgotten check_startmsgs && echo ... with startmsg ... No functional change intended. I adjusted the commit message and did some final clean-ups of the patch before committing. PR: 255207 Reported by: Jose Luis Duran <jlduran@gmail.com> Reviewed by: imp, 0mp Approved by: imp (src) Differential Revision: https://reviews.freebsd.org/D34514 libexec/rc/rc.d/bgfsck | 2 +- libexec/rc/rc.d/cleartmp | 4 ++-- libexec/rc/rc.d/fsck | 4 ++-- libexec/rc/rc.d/hostid | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/ldconfig | 5 ++--- libexec/rc/rc.d/motd | 4 ++-- libexec/rc/rc.d/mountcritlocal | 4 ++-- libexec/rc/rc.d/moused | 4 ++-- libexec/rc/rc.d/newsyslog | 4 ++-- libexec/rc/rc.d/nfsclient | 3 +-- libexec/rc/rc.d/os-release | 4 ++-- libexec/rc/rc.d/pf | 4 ++-- libexec/rc/rc.d/savecore | 2 +- libexec/rc/rc.subr | 11 ++++++++++- share/man/man8/rc.subr.8 | 15 ++++++++++++++- 16 files changed, 49 insertions(+), 29 deletions(-) Thanks! Committed! A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8f2bb173bfc6e1a03a56b5098f8d2af740ce743f commit 8f2bb173bfc6e1a03a56b5098f8d2af740ce743f Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2022-03-13 17:48:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-02-22 12:27:16 +0000 Introduce startmsg and use it in rc scripts startmsg is a new rc.subr(8) function function to be used instead of echo(1) when for boot messages. It replaces the often forgotten check_startmsgs && echo ... with startmsg ... No functional change intended. I adjusted the commit message and did some final clean-ups of the patch before committing. PR: 255207 Reported by: Jose Luis Duran <jlduran@gmail.com> Reviewed by: imp, 0mp Approved by: imp (src) Differential Revision: https://reviews.freebsd.org/D34514 (cherry picked from commit 325ebf37d8efc6488754051fcc2b1aaa40cefd8b) libexec/rc/rc.d/bgfsck | 2 +- libexec/rc/rc.d/cleartmp | 4 ++-- libexec/rc/rc.d/fsck | 4 ++-- libexec/rc/rc.d/hostid | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/ldconfig | 5 ++--- libexec/rc/rc.d/motd | 4 ++-- libexec/rc/rc.d/mountcritlocal | 4 ++-- libexec/rc/rc.d/moused | 4 ++-- libexec/rc/rc.d/newsyslog | 4 ++-- libexec/rc/rc.d/nfsclient | 3 +-- libexec/rc/rc.d/os-release | 4 ++-- libexec/rc/rc.d/pf | 4 ++-- libexec/rc/rc.d/savecore | 2 +- libexec/rc/rc.subr | 11 ++++++++++- share/man/man8/rc.subr.8 | 13 +++++++++++++ 16 files changed, 48 insertions(+), 28 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e8396a9592abb08069009e48b84ead2636681b16 commit e8396a9592abb08069009e48b84ead2636681b16 Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2022-03-13 17:54:39 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-02-22 12:27:50 +0000 rc.d/*: Use startmsg instead of echo on start messages By rc.conf(5), setting rc_startmsgs="NO" should silence start messages. Fix a few rc scripts by using startmsg. PR: 255207 Reported by: Jose Luis Duran <jlduran@gmail.com> Reviewed by: imp, 0mp Approved by: imp (src) Differential Revision: https://reviews.freebsd.org/D34514 (cherry picked from commit 19a6267d61a0c3bd6cd56f19ca3f8a67a54f675c) libexec/rc/rc.d/jail | 16 ++++++++-------- libexec/rc/rc.d/local | 4 ++-- libexec/rc/rc.d/netif | 2 +- libexec/rc/rc.d/ppp | 6 +++--- libexec/rc/rc.d/pppoed | 2 +- libexec/rc/rc.d/rfcomm_pppd_server | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) |
Created attachment 224239 [details] Allow silencing of netif startmsgs. By rc.conf(5), setting `rc_startmsgs="NO"` should silence netif's "Starting Network: lo0 ...".