Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 447076

Summary: sys-apps/openrc: add size limit /run tmpfs by default (e.g. size=10%)
Product: Gentoo Hosted Projects Reporter: cazzantonio <alpiturchi>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 439098    

Description cazzantonio 2012-12-13 09:05:44 UTC
It would be a nice idea to add a size limit on the possibile growth of /run, mounted in tmpfs. The default size is half the amount of available ram, however there is also /dev/shm who is taking up the otherl half, so there could be issues where all the ram gets used by tmpfs.

This isn't a major issue, but maybe one could add a small parameter to line 64 of /lib/rc/sh/init.sh, in this way
mount -t tmpfs -o mode=0755,nosuid,nodev,size="10%" tmpfs /run
the above should be ok on any "modern" machine with more than 64-128MB of ram.

Alternatively one could get the whole amount from:
cat /proc/meminfo |grep MemTotal|tr -s [:blank:]|cut -d" " -f2
and use this value in the script (no limit for really low amounts of ram and 50MB limit for anyone with 512MB or more)
Comment 1 SpanKY gentoo-dev 2012-12-16 23:52:53 UTC
if 10% is too small because someone is running on a really low mem system, then they can just add their own /run line to /etc/fstab
Comment 2 William Hubbs gentoo-dev 2012-12-22 14:48:32 UTC
A 10% size is implemented in commit b00f858.
Thanks for the report.