V
V
vlarkanov2019-04-18 10:01:17
PostgreSQL
vlarkanov, 2019-04-18 10:01:17

Ubuntu 18.04: how to move /var/run from ram to disk?

I ran into a problem that PostgresPro (which is from 1C developers and for 1C) does not start after a reboot. The error was:

IMPORTANT: Could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory

After creating the /var/run/postgresql directory , Postgres started up, but the problem is that /run ( /var/run is a symlink to /run ) is mounted in RAM:
mount | grep "/run"
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=13199304k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k )
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/999 type tmpfs (rw,nosuid,nodev,relatime,size=13199300k,mode=700,uid=999,gid=1001)
tmpfs on /run/user/1004 type tmpfs (rw,nosuid,nodev,relatime,size=13199300k,mode=700,uid=1004,gid=1006)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev ,relatime,size=13199300k,mode=700,uid=1000,gid=1000)

Accordingly, after a reboot, the /var/run/postgresq directory I created disappears and Postgres refuses to start.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Radjah, 2019-04-18
@vlarkanov

If systemd, then add to the unit or make a droplet (systemctl edit unit_name) in the [Service] section:
Then the directory "/var/run/postgresql" will be created when the unit is started
https://www.freedesktop.org/software/systemd/ man/s...

D
Dmitry Kinash, 2019-04-18
@Dementor

Or maybe you just need to open the postgri config and specify a real-life directory?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question