[Clfs-dev] /var/run

sjs205 sjs205.linux at gmail.com
Fri May 13 09:09:25 PDT 2011


Ok, have looked into this a little further and have a working tmpfs 
/var/run fs.

What I did:
* Added a line to /etc/fstab:
	varrun /var/run tmpfs defaults 0 0
	This was enough to get the basic tmpfs dir.
* Then edited the /etc/rc.d/init.d/cleanfs script and added a section 
just before all files get removed from /var/run as follows:
                 if [ ! -f ./utmp ]
                 then
                         touch ./utmp
                 fi


I have created a patch for this. Obviously this patch implies a few 
amendments to the book - added line in fstab and no need to 'touch' umtp 
- so I have created a patch for this too.

If anybody thinks I have gone about this the wrong way then please do 
let me know, or just feel free to pass comments.


sjs205

Book patch - http://pastebin.cross-lfs.org/230502
bootscripts-cross-lfs-1.1.0 http://pastebin.cross-lfs.org/230503

> Hello All,
>
> Every couple of days I manage to inadvertently cut the power to my
> CLFS x86 server. Since I only really SSH to this box this presents a
> problem since the SSH pid file doesn't get removed on power failure so
> I have to connect up a screen, delete /var/run/sshd.pid then restart ssh.
>
> This is caused by the static setup of the /var/run dir so I have
> decided to address this.
>
> My plan:
> * Create a start-up script in /etc/rc.d/init.d that will remove all
> files from the /var/run directory, then mount a tmpfs using /var/run
> as the mount point.
>
> With this in mind, before I start, just a few questions related to this:
> * Should this be a separate script in init.d or should I add it to an
> existing one? I am thinking that a script is required for the removing
> old PID files, but the mounting of the tmpfs could be carried out by
> S30mountfs - by adding a mount point to /etc/fstab - in the
> /etc/rc.d/rcsysinit.d/ directory.
> * Can anybody recommend a size for the tmpfs. Running 'du -ah' on the
> /var/run dir, the contents are only 96 k, but then the same command on
> my Fedora box shows the dir to be 1.8 MB in size.
>
> Does everyone agree that this is a necessary course of action? Any
> comments or recommendations welcome - I am generally on the CLFS IRC
> so come chat there or just return email.
>
> sjs205
>
>




More information about the Clfs-dev mailing list