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, Apr 19, 12:27 PM
Unknown Object (File)
Thu, Apr 11, 7:49 PM
Unknown Object (File)
Thu, Apr 4, 1:31 AM
Unknown Object (File)
Feb 18 2024, 3:52 AM
Unknown Object (File)
Dec 20 2023, 2:39 AM
Unknown Object (File)
Dec 2 2023, 6:32 AM
Unknown Object (File)
Nov 28 2023, 1:19 PM
Unknown Object (File)
Nov 28 2023, 1:19 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 24940
Build 23665: 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.