I'm trying to stop PostgreSQL but this results in a weird error about /proc/
:
root@dw0wanydbpv14fred:~# service postgresql stop
* Stopping PostgreSQL 9.3 database server
* Error: /proc must be mounted <----- what ???
To mount /proc at boot you need an /etc/fstab line like:
proc /proc proc defaults
In the meantime, run "mount proc /proc -t proc"
Error: pid file is invalid, please manually kill the stale server process. [fail]
But /proc
has already been mounted:
# ls -ld /proc
drwxr-xr-x 33 root root 0 Aug 27 23:52 /proc
Trying to mount it again (as the error message suggests) fails:
# mount proc /proc -t proc
mount: proc already mounted
It's mounted automatically actually:
# cat /etc/fstab
proc /proc proc defaults 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
none /run/shm tmpfs defaults 0 0
Do you have any idea about what might be happening? Why can I not stop PostgreSQL, why the error about /proc/
?
ps
works:
# ps
PID TTY TIME CMD
508 pts/1 00:00:00 bash
591 pts/1 00:00:00 ps
This is a newly provisioned OpenVZ virtuailzed ubuntu-14.04-x86_64-minimal
server hosted by Wable (wable.com). I haven't done much more than configuring the locale to UTF-8 and installing PostgreSQL: aptitude install postgresql-9.3 postgresql-contrib-9.3
.
This StackOverflow answer suggest setting the permissions on /proc/
but I cannot believe the permissions would be wrong by default? I followed the suggestion to change the permissions of /proc/
to 755, didn't help.
Update 1 day later: Some more details, as requested:
# ls -l /proc/meminfo
-rwx--x--x 1 root root 0 Aug 31 01:03 /proc/meminfo
# ls -la /proc | grep '???' # finds nothing
#
# uname -a
Linux dw0wanydbpv14fred 2.6.32-042stab092.2 #1 SMP Tue Jul 8 10:35:55 MSK 2014 x86_64 x86_64 x86_64 GNU/Linux
Running ps
as another user (Postgres) doesn't work: (feels weird. And does service postgresql stop
switch user?)
root@dw0wanydbpv14fred:~# su - postgres
postgres@dw0wanydbpv14fred:~$ ps
Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
proc /proc proc defaults
In the meantime, run "mount proc /proc -t proc"
I created a brand new user as well (useradd username
), it got the same error.
dmesg
says nothing at all:
# dmesg
#
And var/log/syslog
contains nothing interesting, only some uninteresting messages from cron.
After having run the above commands, I granted the read permission on /proc/meminfo
to everyone, didn't help:
# ll -l /proc/meminfo
-rwxr-xr-x 1 root root 0 Aug 31 01:13 /proc/meminfo*
(I still get the same error: Error: /proc must be mounted
.)
Update 2: I'm able to reproduce the error like so:
Create a new OpenVZ ubuntu-14.04-x86_64-minimal at Wable.com. Then:
apt-get update
apt-get upgrade
locale-gen en_US.UTF-8
update-locale LANG=en_US.utf-8 LC_MESSAGES=POSIX
apt-get install postgresql-9.3 postgresql-contrib-9.3
After this, service commands fail with "Error: /proc must be mounted" (also after a reboot):
# service postgresql status
9.3/main (port 5432): online
# service postgresql stop
* Stopping PostgreSQL 9.3 database server
* Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
proc /proc proc defaults
In the meantime, run "mount proc /proc -t proc"
Error: pid file is invalid, please manually kill the stale server process.
I've created a ticket at the hosting provider.