FS#17240 - [laptop-mode-tools] add mkdir /var/run/laptop-mode-tools/ to rc.d script

Attached to Project: Arch Linux
Opened by jon (emphire) - Sunday, 22 November 2009, 03:56 GMT
Last edited by Eric Belanger (Snowman) - Thursday, 26 November 2009, 20:12 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Eric Belanger (Snowman)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No



I run /var/run on a tmpfs so /var/run gets wiped clean each time I reboot. laptop-mode-tools writes to the directory /var/run/laptop-mode-tools/ and gives an error message when starting if it is missing.

Would it be possible to add "mkdir -p /var/run/laptop-mode-tools/" to the rc.d script before loading laptop-mode-tools?


Additional info:
* package version(s): laptop-mode-linux-1.52-1

Steps to reproduce:
echo "tmpfs /var/run tmpfs size=2M 0 0" >> /etc/fstab
mount /var/run
/etc/rc.d/laptop-mode start
This task depends upon

Closed by  Eric Belanger (Snowman)
Thursday, 26 November 2009, 20:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in svn
Comment by Gerardo Exequiel Pozzi (djgera) - Sunday, 22 November 2009, 21:38 GMT
It would be great if this is implemented, but no great intentions some time ago. Please see  FS#13231 
Comment by Eric Belanger (Snowman) - Sunday, 22 November 2009, 23:04 GMT
This is a filesystems and initscripts issue as /var/run is part of the filesystems package and all daemons use it. Reassinging to the appripriate devs.
Comment by Aaron Griffin (phrakture) - Wednesday, 25 November 2009, 18:02 GMT
I don't see how this is a filesystems issue as the exact dir in question is "/var/run/laptop-mode-tools" and not "/var/run/"

I don't see an issue with creating this in the initscript
Comment by Eric Belanger (Snowman) - Wednesday, 25 November 2009, 18:47 GMT
The "/var/run/laptop-mode-tools" is included in the package:
$ pacman -Ql laptop-mode-tools |grep run
laptop-mode-tools /var/run/
laptop-mode-tools /var/run/laptop-mode-tools/

It's missing here because the user is using tmpfs for /var/run. Isn't this bug in fact a request for tempfs support for /var/run? See http://www.archlinux.org/pipermail/arch-general/2009-February/003564.html
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 25 November 2009, 18:58 GMT
Is a trivial change, just adding a line to a rc script making this more easy. See for example rc for hal: /var/run/directories are in the package but rc always check for each directory in /var/run and make if not exists.

Remember that pacman does not track directories, only files.
Comment by Eric Belanger (Snowman) - Wednesday, 25 November 2009, 19:33 GMT
OK, I'll add the line next time I update the package.
Comment by jon (emphire) - Wednesday, 25 November 2009, 19:45 GMT
Hi Eric. That is correct. I just read the thread you mentioned and I can see where everyone is coming from and that it's a bit controversial. I'd made the change on my rc.d script and thought other users might find it useful.

I can't think of any action a user might want to take other than creating the missing directory in when one is missing under /var/run... I don't understand why pacman would be hadling any files under /var/run since they are dynamically created and deleted... should directories be any different?
Comment by jon (emphire) - Wednesday, 25 November 2009, 19:47 GMT
Sorry for going on after the fact. I didn't see the two comments above mine before posting. Thanks Eric!