Arrange to fsync the contents of lockfiles (both postmaster.pid and the
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Aug 2010 17:33:01 +0000 (17:33 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Aug 2010 17:33:01 +0000 (17:33 +0000)
commite74ced85dc9b6520450d6dbf8ba9cf272c1465db
treed3bb3165b41d3af75753b7c9cc25ffb691798d83
parent00fb7f5e58738e02a3649a8f0c8e20dadb8f1af7
Arrange to fsync the contents of lockfiles (both postpid and the
socket lockfile) when writing them.  The lack of an fsync here may well
explain two different reports we've seen of corrupted lockfile contents,
which doesn't particularly bother the running server but can prevent a
new server from starting if the old one crashes.  Per suggestion from
Alvaro.

Back-patch to all supported versions.
src/backend/utils/init/miscinit.c