I've been using PostgreSQL on CentOS for several years without a glitch.
Since upgrading to CentOS 7.2 I experienced a crash for the first time.
PANIC: semop(id=..) failed: Invalid argument
While digging into the problem I noticed that the crashed happened all the time after a crontab script ran.
Doing an Internet search revealed the problem is due to systemd 212 that came with Centos 7.2 as it has the feature of removing all IPC objects owned by a user if she or he fully logs out.
The solution is to set
/etc/systemd/logind.conf and to restart
systemd-logind service to disable this.
This is why it's good to do LVM or VM snapshots before upgrading, to ensure you have a way to revert in case the problems are too severe.