FS#14889 - Support /var/run being on tmpfs filesystem, for laptop-mode-tools

Attached to Project: Arch Linux
Opened by Anonymous Submitter - Sunday, 31 May 2009, 09:26 GMT
Last edited by Jan de Groot (JGC) - Sunday, 31 May 2009, 19:13 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 0
Private No

Details

Description:

To avoid using the SSD drive in my Dell Mini 9, to minimise wear, one suggestion I've encountered is to put any file systems that don't need to be preserved across boots on a tmpfs file system e.g. in /etc/fstab

#http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/
# use RAM for various temporary file systems
tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=256M 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777,size=256M 0 0
tmpfs /var/lock tmpfs defaults,noatime,mode=1777,size=256M 0 0
tmpfs /var/run tmpfs defaults,noatime,mode=755,size=256M 0 0

I've had no significant issues with any of the daemons I'm using, except the laptop-mode-utils. It presumes that the directory /var/run/laptop-mode is persisent, and therefore when it starts, the

touch /var/run/laptop-mode-tools/enabled

command in /etc/rc.d/laptop-mode fails.

I'd like to suggest that the following "if" section is added to the /etc/rc.d/laptop-mode script, creating that directory if it doesn't exist, and setting it's correct permissions and ownership:

--
case "$1" in
start)
stat_busy "Starting laptop-mode"

# support /var/run being on a tmpfs file system
if [ ! -d /var/run/laptop-mode-tools ]; then
mkdir -m 755 /var/run/laptop-mode-tools
chown root:root /var/run/laptop-mode-tools
fi

touch /var/run/laptop-mode-tools/enabled
--

Additional info:
* package version(s)

laptop-mode-tools 1.47-1


Thanks,
Mark.
This task depends upon

Closed by  Jan de Groot (JGC)
Sunday, 31 May 2009, 19:13 GMT
Reason for closing:  Duplicate
Additional comments about closing:  See  bug 13231 .
Comment by Jan de Groot (JGC) - Sunday, 31 May 2009, 12:03 GMT
There's more packages which have this problem, if you want to mount /var/run on a ramdisk, you should add something in the system bootup scripts that initializes /var/run. The next example is policykit, which comes without an initscript.
On OpenBSD this is easy to do from /etc/fstab, but I think that's openbsd-specific. On Linux I think you'll need to add some scripting.
Comment by Greg (dolby) - Sunday, 31 May 2009, 14:35 GMT
See  FS#13204  and all linked ones and the ML discussion link.
Comment by Greg (dolby) - Sunday, 31 May 2009, 14:37 GMT
 FS#13231  is the laptop-mode-tools one.

Loading...