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)
Fri, Mar 22, 11:43 PM
Unknown Object (File)
Fri, Mar 22, 11:43 PM
Unknown Object (File)
Fri, Mar 22, 11:43 PM
Unknown Object (File)
Fri, Mar 22, 11:43 PM
Unknown Object (File)
Fri, Mar 22, 11:43 PM
Unknown Object (File)
Mar 8 2024, 3:55 AM
Unknown Object (File)
Feb 14 2024, 9:38 PM
Unknown Object (File)
Jan 11 2024, 10:54 PM
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

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.