Page MenuHomeFreeBSD

Add rcorder(8) support to /etc/rc.resume
ClosedPublic

Authored by eugen_grosbein.net on May 1 2018, 3:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 12:38 PM
Unknown Object (File)
Sat, Nov 16, 2:16 AM
Unknown Object (File)
Oct 12 2024, 3:09 PM
Unknown Object (File)
Sep 13 2024, 12:22 AM
Unknown Object (File)
Sep 9 2024, 1:11 AM
Unknown Object (File)
Sep 8 2024, 7:24 PM
Unknown Object (File)
Sep 5 2024, 12:34 PM
Unknown Object (File)
Sep 2 2024, 4:24 AM
Subscribers

Details

Summary

Add rcorder(8) support to /etc/rc.resume, so it calls "rcorder -k resume" and runs rcNG scripts containing "KEYWORD: resume" with single "resume" argument.

Working example is sysutils/cpupdate version g20180324_1 that defines extra_commands="resume" to reload CPU microcode cleared by suspend/resume sequence.

This change does nothing if system has no rcNG scripts with "KEYWORD: resume" inside.

Test Plan
  1. Use FreeBSD system with hardware supporting sleep/resume and Intel CPU that lacks IBRS support out of box but has microcode update bringing IBRS in.
  2. Install sysutils/cpupdate version g20180324_1 or newer and enable it in /etc/rc.conf (cpupdate_enable="YES").
  3. Make the system sleep/resume that clears loaded CPU microcode. WIth patch applied, rc.resume calls "service cpupdate resume" and microcode reloaded automatically.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

should probably be documented somewhere.
mabe add a cross ref (see also) in the rc and rcorder man pages and add sections to whatever man pages mention how to resume (or add one)

julian requested changes to this revision.May 5 2018, 6:19 PM

docs needed

This revision now requires changes to proceed.May 5 2018, 6:19 PM

We have only one manual page acpiconf(8) that mentions /etc/rc.resume with exception of ancient apmd(8) page that is installed for i386 systems only. I've added needed description to acpiconf(8).

It would be nice to add a mention of rc.resume and the new resume keyword to rc(8) as Julian suggested.

In D15247#323501, @avg wrote:

It would be nice to add a mention of rc.resume and the new resume keyword to rc(8) as Julian suggested.

I would rather not duplicate same documentation in different places.
/etc/rc.resume is not used for auto-reboot nor general daemon startup described in rc(8).

Do you have any idea how to mention rc.resume in rc(8) correctly?

In D15247#323501, @avg wrote:

It would be nice to add a mention of rc.resume and the new resume keyword to rc(8) as Julian suggested.

I would rather not duplicate same documentation in different places.
/etc/rc.resume is not used for auto-reboot nor general daemon startup described in rc(8).

Do you have any idea how to mention rc.resume in rc(8) correctly?

as mentioned before, add some cross referencing in the related man pages. Use the "See also" sections.

Do you have any idea how to mention rc.resume in rc(8) correctly?

as mentioned before, add some cross referencing in the related man pages. Use the "See also" sections.

I don't see why rc(8) needs silent reference to acpiconf(8) as they are not related at all.

Add reference to rcorder(8) manual page.

sbin/rcorder/rcorder.8
154 ↗(On Diff #42322)

It seems that rc.shutdown.8 is just an alias for rc.8, do we add a cross-references in such a case?
What precedents do we have?

Also, rc.8 has a section named "Operation of rc.shutdown".
Would it make sense to add a similar small section for rc.resume?
And rc.resume.8 alias for rc.8 (similarly to shutdown).

NAME

rc - command scripts for auto-reboot and daemon startup

/etc/rc.d/rc.resume is just script called by devd (see /etc/devd.conf) or apmd.conf (see /etc/apmd.conf). It has nothing to do with rc(8) auto-reboot or daemon startup procedures. I do not see why its description should be there.

It seems that rc.shutdown.8 is just an alias for rc.8, do we add a cross-references in such a case?

Yes, it is for now. I do not see how this could be bad. OTOH, I can imagine rc.shutdown.8 be separated from rc,8 to distinct file, so I prefer to link to the name, not to the file.

NAME

rc - command scripts for auto-reboot and daemon startup

/etc/rc.d/rc.resume is just script called by devd (see /etc/devd.conf) or apmd.conf (see /etc/apmd.conf). It has nothing to do with rc(8) auto-reboot or daemon startup procedures. I do not see why its description should be there.

By the same logic, rc.shutdown is just a script called by init.
rc.resume shares infrastructure with rc and you are extending that sharing.
I do not see why rc.resume cannot be described in rc.

It seems that rc.shutdown.8 is just an alias for rc.8, do we add a cross-references in such a case?

Yes, it is for now. I do not see how this could be bad. OTOH, I can imagine rc.shutdown.8 be separated from rc,8 to distinct file, so I prefer to link to the name, not to the file.

I understand your opinion. I asked for rules and precedents. Please research.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 27 2018, 5:21 PM
This revision was automatically updated to reflect the committed changes.