Page MenuHomeFreeBSD

rc.d/motd: Update motd more robustly
ClosedPublic

Authored by cem on Jun 19 2019, 8:06 PM.
Tags
None
Referenced Files
F173939141: D20701.diff
Tue, Sep 29, 12:36 PM
Unknown Object (File)
Thu, Sep 24, 3:26 PM
Unknown Object (File)
Thu, Sep 24, 8:36 AM
Unknown Object (File)
Mon, Sep 21, 8:03 PM
Unknown Object (File)
Sun, Sep 20, 10:37 PM
Unknown Object (File)
Sat, Sep 19, 3:21 AM
Unknown Object (File)
Fri, Sep 18, 3:32 AM
Unknown Object (File)
Mon, Sep 14, 8:18 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.