This doesn't make sense to me. A reboot will absolutly kill any existing shared memory blocks, how can it possibly be complaining about it?
PostgreSQL complains if it finds a postmaster.pid. As far as I can tell it doesn't have anything to do with shared memory except that we are tracking info in the postmaster.pid. Info that is no longer valid.
What would make sense to me, would be to read the pid file, check the process list. If the process that is in the pid file is not in the process list, we remove the pid file and start.
Sincerely, Joshua D. Drake