Here is an ebuild and init.d/conf.d set for swapd. swapd polls the kernel and creates new swap files when free memory (as swap + memory) is below a given limit. The swap files are destroyed if there is ample memory for a certain timeout. This povides a fallback to pre-empt OOM (which pissed me off earlier when EMERGE got KILLED while INSTALLING xorg-x11), and may also be useful to new users.
Created attachment 35838 [details] sys-apps/swapd/swapd-0.4.0a.ebuild swapd ebuild
Created attachment 35839 [details] files/swapd.conf.d conf.d for swapd, needed by ebuild
Created attachment 35840 [details] files/swapd.init.d init.d for swapd, needed by ebuild
I should note, I tried /etc/swapd.conf and --config; swapd ignored it, hence the ugly hack with the conf.d
latest is 0.6
Can you please test this with the latest version 0.4.0? Please change the headers of conf.d and ebuild KEYWORDS="-* ~x86" - why is "-*" in the ebuild? Does it not work on the other archs? IUSE="" should be always in ebuilds and you should use emake all instead of make all. Here is also an interesting article about the OOM-killer, and how to stop it from killing :) http://lwn.net/Articles/104179/
Created attachment 45341 [details] swapd-1.0.2.ebuild ebuild for swapd-1.0.2 the init.d needs to be fudged for this a bit. I'll work it out later.
I just want to remark that there are at least to different projects called swapd and those already got mixed up here. Maybe either one should use separate names for those separate projects or there should be a general decision which one should become the one primarily used by gentoo based on things like stability or portability. Considering the gentoo attitude of choice probably there need to be different names like - "linux-swapd" http://sourceforge.net/projects/swapd/ and "portable-swapd" http://www.rkeene.org/oss/swapd/
upstream url unreachable