Page MenuHomeFreeBSD

rc.d/motd: Update motd more robustly
ClosedPublic

Authored by cem on Jun 19 2019, 8:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 6, 6:20 PM
Unknown Object (File)
Thu, Mar 5, 11:47 AM
Unknown Object (File)
Thu, Mar 5, 3:20 AM
Unknown Object (File)
Fri, Feb 27, 11:24 PM
Unknown Object (File)
Thu, Feb 26, 9:34 PM
Unknown Object (File)
Thu, Feb 26, 7:01 PM
Unknown Object (File)
Nov 24 2025, 4:23 PM
Unknown Object (File)
Nov 21 2025, 12:31 PM
Subscribers

Details

Summary

Use appropriate fsyncs to persist the rewritten /etc/motd file, when a
rewrite is performed.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24941
Build 23666: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jun 19 2019, 8:09 PM

As mjg@ points out, the mktemp file may be on a different filesystem than /etc
(e.g., tmpfs, but any other filesystem invalidates the initial fsync). Copy to
a temporary /etc file, sync that, then rename over /etc/motd.

This revision now requires review to proceed.Jun 19 2019, 8:21 PM
This revision is now accepted and ready to land.Jun 19 2019, 9:07 PM
This revision was automatically updated to reflect the committed changes.