[QCLUG] Ubuntu /var/run
Chris Cooper
QCAdmin@gmail.com
Mon, 6 Apr 2009 19:26:31 -0500
Today I ran into an interesting issue. Under Ubuntu, /var/run and
/var/lock exist as ram drives.
root@TheNozzle:~# mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
The reasoning behind this (as posted on the dev forums) is so that
file locks and PID files will be cleared during a reboot.
While this isn't a horrible way to do this, it does create a few unique issues.
The issue I ran into today was trying to hard link a socket created in
/var/run into a chroot. Since hard links can't span multiple
partitions, I had to get creative.
While this isn't a huge issue for 99% of people (this is the first
time I even noticed this after using Ubuntu for several years), it is
something to keep in back of your head if you write a lot of shell
scripts, or interact with daemons and sockets that live in /var/run
Cooper