Page MenuHomeFreeBSD

Add a devd_flags option to the devd rc.d script
AbandonedPublic

Authored by nonesuch_longcount.org on Sep 28 2021, 3:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 5:00 AM
Unknown Object (File)
Sun, Apr 7, 11:56 PM
Unknown Object (File)
Feb 9 2024, 11:16 AM
Unknown Object (File)
Dec 20 2023, 4:11 AM
Unknown Object (File)
Nov 19 2023, 3:45 AM
Unknown Object (File)
Nov 19 2023, 3:44 AM
Unknown Object (File)
Nov 19 2023, 3:14 AM
Unknown Object (File)
Sep 12 2023, 1:04 AM
Subscribers

Details

Summary

In some cases I need to both use devd but I do not want it to spam syslog with updates. An example of this is when using FreeBSD inside of vmware there are some configurations that cause devd to excessively log updates like this

2021-09-27T18:30:33.626995+00:00 syslog devd[445] Processing event '!system=CAM subsystem=periph type=error device=cd0 serial="10000000000000000001" cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 00" CDB="00 00 00 00 00 00 " '
2021-09-27T18:30:33.627006+00:00 syslog devd[445] Pushing table

My change allows admins to start devd -q by way to adding devd_flags="-q" to /etc/rc.conf

Test Plan
  1. Patch devd rc.d file.
  2. Add devd_flags="-q" to /etc/rc.conf
  3. Restart devd
  4. Reboot system test if same condition is met on a cold boot.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

nonesuch_longcount.org updated this revision to Diff 95870.
nonesuch_longcount.org created this revision.
This revision is now accepted and ready to land.Sep 28 2021, 6:57 PM
driesm requested changes to this revision.EditedSep 28 2021, 7:15 PM
driesm added a subscriber: driesm.

Can you try just setting devd_flags="-q" without changes to the devd script?
IIRC, "$name_flags" is always appended even if its not explicitly done in the separate script.

Its documented under rc.subr(8) ${name}_flags.

This revision now requires changes to proceed.Sep 28 2021, 7:15 PM

So I am not sure how I missed this in the defaults/rc.conf and rc.subr. However I am not sure its noted anywhere other then rc.subr that run_rc_command "$1" will do $name + $name_flags etc .
As an alternate proposal is there a example rc.d script that shows off all of the options and rc.conf settings ?

I don't think so unfortunately. I noticed this "learning the hard way myself" when I was testing an RC script at one point and I saw my flags passed twice on "ps -aux" :-D.
I should probably do a sweep of the ports tree as well at some point to get rid of all the wrong $name_flags usages.

I am not sure why I am a reviewer on this (maybe related to a PR not mentioned) but my rc-foo is abysmal so I am really not the right person to look at this.

@nonesuch_longcount.org, I suggest that you abandon this Revision instead of leaving it open.
Given the functionality you need is already present.

This revision is now accepted and ready to land.Dec 11 2021, 9:30 AM