Michael Paquier wrote: > On Tue, Sep 27, 2016 at 2:13 PM, raf <raf@xxxxxxx> wrote: > > So, my qestion is, is it possible that "pg_ctl status" could be > > removing postgres's semaphores and can I stop it? It seems > > extremely unlikely. So, if it isn't, what else could it be? > > Systemd perhaps? It's been known to kill screen/tmux/nohup > > processes when a user logs out in its keenness to clean up but > > that may be clutching at straws. > > systemd sometimes has fun removing semaphores. See here for example: > https://www.postgresql.org/message-id/CAK7tEys9-O4BTERbs3Xuk2BfFNNd55u2sM9j5R2Fi7v6BHjrQw@xxxxxxxxxxxxxx > -- > Michael Thanks, Michael. That's it. I added RemoveIPC=no to /etc/systemd/logind.conf, restarted systemd-logind, and re-enabled the cron job, and it's been fine for a whole day. Now to do the same on all my other systemd-afflicted hosts (just on principal). :-) It looks to me like a bug in systemd. If it's removing IPC resources because it thinks that the postgres user has completely "logged out", why does it take over 100 "logins" (i.e. cronjobs) before it decides that the postgres user is completely logged out. What was the difference between all the previous cronjobs and the one where it finally decided to remove the semaphores? Why didn't it remove them after the first cronjob had completed? And why did it think the postgres user was completely "logged out" when it's also running the postgres server processes? It might be because it sees the postgres server processes as belonging to my user "slice" because I started it even though it's running as the postgres user. That doesn't seem like a useful way of viewing things. But this is all rhetorical. No doubt there are reasons for this but I don't care as long as I can turn it off. Thanks again, raf -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general