3 %define release 15.planetlab%{?date:.%{date}}
5 Summary: PlanetLab mom -- Cleans up your mess
10 Group: System Environment/Kernel
11 Source: %{name}-%{version}.tgz
13 Packager: PlanetLab Central <support@planet-lab.org>
14 Distribution: PlanetLab 2.0
15 URL: http://www.planet-lab.org
16 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20 A small daemon that watches the consumed swap space. At 90% utilization, it
21 resets the slice that is the biggest memory hog. At 95% utilization, it
31 mkdir -p $RPM_BUILD_ROOT/usr/local/planetlab/bin/
32 mkdir -p $RPM_BUILD_ROOT/etc/init.d/
34 cp pl_mom $RPM_BUILD_ROOT/etc/init.d/
35 cp pl_mom.pl $RPM_BUILD_ROOT/usr/local/planetlab/bin/
38 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
41 %defattr(0755, root, root)
43 /usr/local/planetlab/bin/pl_mom.pl
47 if [ -a /var/run/pl_dod.pid ]; then
48 /etc/init.d/pl_dod stop
51 while [ $cnt -le 6 ]; do
52 file="/etc/rc$cnt.d/K02pl_dod"
56 file="/etc/rc$cnt.d/S98pl_dod"
64 RUNLEVEL=`/sbin/runlevel`
66 if [ "$1" -ge 1 ]; then
68 chkconfig --add pl_mom
69 chkconfig --level 3 pl_mom on
71 if [[ "$RUNLEVEL" != "unknown" ]]; then
72 /etc/init.d/pl_mom stop
73 /etc/init.d/pl_mom start
78 RUNLEVEL=`/sbin/runlevel`
80 if [ "$1" -eq 0 ]; then
81 if [[ "$RUNLEVEL" != "unknown" ]]; then
82 /etc/init.d/pl_mom stop