0

I have found that it lacks /run/lock directory.

And I cannot find out what daemon/init script creates it.

Could you give me a hint?

Just to make it clear:

1.

# mount
/var/lib/vz/private/101 on / type simfs (rw,relatime)
/dev/sdb on /var/lib/mysql type ext4 (rw,noatime,relatime,barrier=1,data=ordered)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
varrun on /run type tmpfs (rw,relatime)

2.

# ls -la /run/l*
ls: cannot access /run/l*: No such file or directory
zerkms
  • 1,472

2 Answers2

1

/run/lock used to be /var/lock.

It should be cleaned up or recreated during the boot process, for Ubuntu I am not sure which script does it.

However, I know for LFS the /etc/rc.d/init.d/cleanfs script does the job => http://www.linuxfromscratch.org/lfs/view/stable/scripts/apds12.html

Some background:

/var/run => /run is in memory filesystem (tmpfs) used for storing temporary system or state files (e.g. PID, Unix socket, etc...) that do NOT require persistence across reboots.

see => What are "/run/lock" and "/run/shm" used for?

To manually create / mount

sudo mkdir -p /run
sudo chmod 755 /run
sudo mount -t tmpfs -o rw,noexec,nosuid,size=10%,mode=0755 tmpfs /run

BTW: some off-topic stuff about tmpfs VS ramfs

  • tmpfs swaps out to disk but ramfs does NOT
  • tmpfs has fixed size (specified) but ramfs does NOT (you can keep writing even exceeds the max size)
Terry Wang
  • 9,775
0

Well, I could remount it using plain old

mount -o remount /run/lock

and it's defined in /lib/init/fstab

zerkms
  • 1,472