Why are the contents of /dev/shm/ is being removed automatically
From my answer:
After hours of searching and reading, I found the culprit. It's a setting for
systemd
. The/etc/systemd/logind.conf
contains default configuration options, with each of them commented out. TheRemoveIPC
option is set toyes
by default. That option tellssystemd
to clean up interprocess communication (IPC) for "user accounts" who aren't logged in. This does not affect "system accounts"In my case, the files and directories were being created for a user account, not a system account.
There are two possible solutions:
- Create the files with/for a system user -- a user created with the system option (
adduser -r
oradduser --system
)- Edit
/etc/systemd/logind.conf
, uncomment the lineRemoveIPC=yes
, change it toRemoveIPC=no
, save, and reboot the systemIn my case, I went with option #2 because the user was already created.
References:
- RemoveIPC prematurely removes IPC segments
- Change default value of RemoveIPC in logind.conf
- PostgreSQL: Systemd
- Oracle: 3.5 Database Installation and Operation Fails if RemoveIPC=yes Is Configured for systemd