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)
Sun, Apr 5, 3:56 PM
Unknown Object (File)
Fri, Mar 27, 2:37 PM
Unknown Object (File)
Mar 6 2026, 6:20 PM
Unknown Object (File)
Mar 5 2026, 11:47 AM
Unknown Object (File)
Mar 5 2026, 3:20 AM
Unknown Object (File)
Feb 27 2026, 11:24 PM
Unknown Object (File)
Feb 26 2026, 9:34 PM
Unknown Object (File)
Feb 26 2026, 7:01 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.