You are not logged in.
Hi
due to space problem in /var i did this https://wiki.archlinux.org/index.php/Po … _directory
now i cant start postgre trough systemd, journal -xe gives this error
FATAL: could not create lock file "postmaster.pid": Read-only file system I can however start the postgresql if i do this:
sudo -u postgres pg_ctl -D /etc/pgroot/postgres/data start these are the permisions on the new folder
miguel@archlaptop ~> sudo ls -l /etc/pgroot/postgres/data
total 112
drwx------ 5 postgres postgres 4096 Jan 20 18:30 base
drwx------ 2 postgres postgres 4096 Jan 20 18:35 global
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_clog
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_dynshmem
-rw------- 1 postgres postgres 4468 Jan 20 18:30 pg_hba.conf
-rw------- 1 postgres postgres 1636 Jan 20 18:30 pg_ident.conf
drwx------ 4 postgres postgres 4096 Jan 20 18:30 pg_logical
drwx------ 4 postgres postgres 4096 Jan 20 18:30 pg_multixact
drwx------ 2 postgres postgres 4096 Jan 20 18:35 pg_notify
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_replslot
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_serial
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_snapshots
drwx------ 2 postgres postgres 4096 Jan 20 18:35 pg_stat
drwx------ 2 postgres postgres 4096 Jan 20 18:35 pg_stat_tmp
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_subtrans
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_tblspc
drwx------ 2 postgres postgres 4096 Jan 20 18:30 pg_twophase
-rw------- 1 postgres postgres 4 Jan 20 18:30 PG_VERSION
drwx------ 3 postgres postgres 4096 Jan 20 18:30 pg_xlog
-rw------- 1 postgres postgres 88 Jan 20 18:30 postgresql.auto.conf
-rw------- 1 postgres postgres 21310 Jan 20 18:30 postgresql.conf
-rw------- 1 postgres postgres 51 Jan 20 18:35 postmaster.optsThanks
Last edited by archoriano (2016-01-20 19:21:48)
Offline
Offline
my /var has 13GB total space and only 2GB free, im building a datawarehouse so 2gb is not enough
i dont care if it is on /etc or anywhere else it just cant be either /var or /home because i have no space there
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=forking
TimeoutSec=120
User=postgres
Group=postgres
Environment=PGROOT=/etc/pgroot/postgres
SyslogIdentifier=postgres
PIDFile=/etc/pgroot/postgres/data/postmaster.pid
ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data
ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
# killing Postgres, so adjust it downward
OOMScoreAdjust=-200
# Additional security-related features
PrivateTmp=true
ProtectSystem=full
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
Offline
Instead of /etc i used /opt and it worked
I sugest editing the archwiki https://wiki.archlinux.org/index.php/Po … _directory in order for another noobs like me dont do the same mistake. Either giving a sugestion folder or saying where it cant be the new folder
Last edited by archoriano (2016-01-20 19:24:15)
Offline
We still don't know the root cause of the problem, so blindly adding hacks like that into the wiki is not a good idea.
What is your filesystem layout?
df -hAlso, have you checked the permissions of said directory that did not work?
Last edited by ayekat (2016-01-20 19:37:15)
Offline
Its not an hack its a sugestion. I did the exact same thing , but chose a diferent directory
the permisions are on the first post
miguel@archlaptop ~> df -h
Sist.fichs Tama Ocup Livre Uso% Montado em
dev 3,9G 0 3,9G 0% /dev
run 3,9G 3,8M 3,9G 1% /run
/dev/sdb1 184G 15G 160G 9% /
tmpfs 3,9G 70M 3,9G 2% /dev/shm
tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
tmpfs 3,9G 284K 3,9G 1% /tmp
/dev/sda6 275G 230G 32G 88% /home
/dev/sda3 13G 9,8G 2,0G 84% /var
tmpfs 794M 16K 794M 1% /run/user/1000im guessing it has something to do with writing permissions on /etc since i got FATAL: could not create lock file "postmaster.pid": Read-only file system
weird thing is, that i could touch files in the directory with both root and postgres user (the owner of the folder)
Maybe you try to change the PGROOT folder to /etc on your PC to see if you can replicate the problem.
Thanks anyway
Offline
I can replicate the error: I just installed postgresql, ran `initdb` (as suggested in the error message when one tries to run postgresql without a database), and I get the same error on the second attempt to run postgresql.
Yet, I still call it a hack, because we don't know the reason for this. Also, I'm not sure whether this is a problem with Postgresql, since the PID file thing seems to be systemd feature.
Offline