Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is an OpenVZ VPS box. For example:

$ 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"

$ sudo ps
[sudo] password for ....:
 PID TTY          TIME CMD
 4699 pts/2    00:00:00 sudo
 4700 pts/2    00:00:00 ps

Its only started recently (possibly since an apt-get upgrade). I also ran locale-gen recently, but I don't see how that would affect things.

uname -a
Linux stormvz1 2.6.32-042stab072.10 #1 SMP Wed Jan 16 18:54:05 MSK 2013 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"

UPDATED

Tried changing /proc, but did not help:

$ ls -ld /proc
dr-xr-xr-x 98 root root 0 Apr  9 20:11 /proc
$ sudo chmod 755 /proc
[sudo] password for ....:
$ ls -ld /proc
drwxr-xr-x 98 root root 0 Apr  9 20:11 /proc
$ ps
Error: /proc must be mounted

Have also done several reboots - largely seems ok, but just this 'glitch'

proc is in fstab, but seems ok:

grep proc /etc/fstab
proc  /proc       proc    defaults    0    0

The files in /proc look like this - which seem ok to my untrained eye:

$ sudo ls -la /proc
[sudo] password for kimptoc:
total 4
drwxr-xr-x 105 root     root        0 Apr  9 20:11 .
drwxr-xr-x  22 root     root     4096 Mar  4 19:18 ..
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 1
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 108
dr-xr-xr-x   6 postfix  postfix     0 Apr 11 02:06 12337
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 139
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 140
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 173
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 2
dr-xr-xr-x   6 www-data www-data    0 Apr  9 21:02 2184
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 251
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 285
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 3
dr-xr-xr-x   6 postfix  postfix     0 Apr 11 07:20 30162
dr-xr-xr-x   6 root     root        0 Apr 11 07:20 30784
dr-xr-xr-x   6 postfix  postfix     0 Apr 11 07:20 30825
dr-xr-xr-x   6 postfix  postfix     0 Apr 11 07:20 30827
dr-xr-xr-x   6 postfix  postfix     0 Apr 11 07:20 30831
dr-xr-xr-x   6 kimptoc  kimptoc     0 Apr 11 07:20 30844
dr-xr-xr-x   6 kimptoc  kimptoc     0 Apr 11 07:20 30845
dr-xr-xr-x   6 root     kimptoc     0 Apr 11 07:20 30907
dr-xr-xr-x   6 root     root        0 Apr 11 07:20 30908
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 315
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 317
dr-xr-xr-x   6 syslog   syslog      0 Apr  9 20:11 401
dr-xr-xr-x   6 bind     bind        0 Apr  9 20:11 419
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 527
dr-xr-xr-x   6 postfix  postfix     0 Apr  9 20:11 531
dr-xr-xr-x   6 mongodb  nogroup     0 Apr  9 22:10 5372
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 557
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 559
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 663
dr-xr-xr-x   6 www-data www-data    0 Apr  9 20:11 667
dr-xr-xr-x   6 root     root        0 Apr  9 20:11 86
-r-xr-xr--   1 root     root        0 Apr 11 07:20 cgroups
-r-xr-xr--   1 root     root        0 Apr 11 07:20 cmdline
-r-xr-xr--   1 root     root        0 Apr 11 07:20 cpuinfo
-r-xr-xr--   1 root     root        0 Apr 11 07:20 devices
-r-xr-xr--   1 root     root        0 Apr 11 07:20 fairsched
-r-xr-xr--   1 root     root        0 Apr 11 07:20 fairsched2
-r-xr-xr--   1 root     root        0 Apr 11 07:20 filesystems
dr-xr-xr--   3 root     root        0 Apr 11 07:20 fs
-r--------   1 root     root        0 Apr 11 07:20 kmsg
-r--r--r--   1 root     root        0 Apr 11 07:20 loadavg
-r-xr-xr--   1 root     root        0 Apr 11 07:20 locks
-r-xr-xr--   1 root     root        0 Apr 11 07:20 meminfo
-r-xr-xr--   1 root     root        0 Apr 11 07:20 modules
lrwxrwxrwx   1 root     root       11 Apr 11 07:20 mounts -> self/mounts
lrwxrwxrwx   1 root     root        8 Apr 11 07:20 net -> self/net
-r--r--r--   1 root     root        0 Apr 11 07:20 partitions
lrwxrwxrwx   1 root     root       64 Apr  9 20:11 self -> 30908
-r-xr-xr--   1 root     root        0 Apr 11 07:20 stat
-r-xr-xr--   1 root     root        0 Apr 11 07:20 swaps
dr-xr-xr-x   1 root     root        0 Apr  9 20:11 sys
--wx--x---   1 root     root        0 Apr 11 07:20 sysrq-trigger
dr-xr-xr--   2 root     root        0 Apr 11 07:20 sysvipc
-r-xr-x---   1 root     root        0 Apr 11 07:20 uptime
-r-xr-xr--   1 root     root        0 Apr 11 07:20 user_beancounters
-r--r--r--   1 root     root        0 Apr 11 07:20 version
-r-xr-xr--   1 root     root        0 Apr 11 07:20 vmstat
dr-xr-x---   3 root     root        0 Apr 11 07:20 vz
share|improve this question
add comment

1 Answer 1

It looks like you, or perhaps a buggy script running as root, changed the permissions of /proc. Check them: ls -ld /proc

This should fix it:

sudo chmod 755 /proc

If this isn't enough, a reboot is probably easiest. You may be able to limp on.

Check if other files in /proc are affected as well: ls -l /proc. Depending on which files were affected, the following may be enough of a fix (this isn't a complete list, only the most important).

sudo chmod -R 755 /proc/[a-z]*
find /proc -type d -exec sudo chmod +x {} +
sudo chmod 600 /proc/kcore /proc/kmsg /proc/kpagecount /proc/kpageflags /proc/vmallocinfo
sudo chmod 200 /proc/sysrq-trigger

Make sure that you don't have a line for /proc in /etc/fstab (it's normally not needed because the startup script mount it early in the boot process anyway), or if you do, it contains only the following (and optionally 0 0 at the end):

proc  /proc  proc  defaults

If your fstab is correct and a reboot doesn't fix everything, you have a bigger problem. Do post at least the output of sudo ls -la /proc and uname -a.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.