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

2 Answers 2

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)
3
  • And what daemon creates it? My question is: it lacks on one machine, how would I fix it.
    – zerkms
    Sep 19, 2013 at 6:08
  • Well, I need to create it back without reboot for obvious reasons :-)
    – zerkms
    Sep 19, 2013 at 6:14
  • You can manually mount it anyway. Will update the answer.
    – Terry Wang
    Sep 19, 2013 at 6:15
0

Well, I could remount it using plain old

mount -o remount /run/lock

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

2
  • 1
    You will probably need sudo to be able to that command. This answer doesn'ät answer the first question, "What creates /run/lock?" ...
    – Alvar
    Sep 19, 2013 at 6:28
  • @Alvar: is it better now?
    – zerkms
    Sep 19, 2013 at 7:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .