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:30 +0000 (17:33 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Aug 2010 17:33:30 +0000 (17:33 +0000)
commit28d27cfdc9f5b18b8695429601bf2440fec17142
tree55977746b6ebd26119c6ee97afb5e5cd34277168
parent9217dee11811b37495766c58e4f67c9b3461c962
Arrange to fsync the contents of lockfiles (both postmaster.pid 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