2

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.

KajMagnus
  • 375
  • 1
  • 4
  • 14
  • While [this bug](https://bugzilla.redhat.com/show_bug.cgi?id=967977) is with lxc, it's really about `libvirt` and may be relevant. What's the output of `ls -l /proc/meminfo` and `ls -la /proc | grep '???'` ? Is there anything in `dmesg` that could be relevant? Also, what's the output of `uname -a`? Finally, what happens if you run `ps` as a non-root user - similar error? – Craig Ringer Aug 30 '14 at 21:43
  • A search for the error suggests that you're certainly not the only one to have hit issues with `/proc` on OpenVZ. It's not clear if they're all the same bug, or different unrelated problems. – Craig Ringer Aug 30 '14 at 21:46
  • @CraigRinger I added the details you asked about. Hmm, I'm thinking one thing I could do is to recreate my VM from scratch and document exactly how I do that, and then tell Wable.com about this — they might want to have a look; perhaps other people that use Wable's OpenVZ are affected as well. – KajMagnus Aug 31 '14 at 05:29
  • Now you know why OpenVZ is so cheap. – Michael Hampton Aug 31 '14 at 09:34
  • You're running a *very* old kernel - 3rd of December, 2009. So it's not surprising you're being bitten by a very old OpenVZ bug that's been fixed for ages. Perhaps you should find a hosting provider that applies updates more than once a half decade. – Craig Ringer Aug 31 '14 at 10:35
  • (Per comment on deleted answer): I made a rather stupid mistake with the kernel release's age. It's a RHEL kernel which has fixes backpatched into it from much newer releases, and the OpenVZ version is based on this kernel. So while it looks like others have had this issue due to OpenVZ bugs in the past, whatever you're encountering is probably new/different/unrelated to those prior problems. – Craig Ringer Sep 04 '14 at 01:18
  • (@CraigRinger In case you wonder what was the issue: the hosting provider has solved it now, see my answer to this question (not very informative though)) – KajMagnus Sep 06 '14 at 07:32

1 Answers1

0

The hosting provider has fixed the issue. I don't know exactly what it was; they replied to my ticket:

We found an selinux issue on the hostnode, this has been permanently correct.
KajMagnus
  • 375
  • 1
  • 4
  • 14