3 %define release 15%{?pldistro:.%{pldistro}}%{?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 3.0
15 URL: http://cvs.planet-lab.org/cvs/pl_mom
16 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
21 A small daemon that watches the consumed swap space. At 90% utilization, it
22 resets the slice that is the biggest memory hog. At 95% utilization, it
25 A cron job which "fixes" various common problems with nodes (dead
26 services, ext3 corruption, zombie SSH sessions) is also installed.
35 mkdir -p $RPM_BUILD_ROOT/usr/local/planetlab/bin/
36 mkdir -p $RPM_BUILD_ROOT/etc/init.d/
38 cp pl_mom $RPM_BUILD_ROOT/etc/init.d/
39 cp pl_mom.pl $RPM_BUILD_ROOT/usr/local/planetlab/bin/
40 cp pl_mop.sh $RPM_BUILD_ROOT/usr/local/planetlab/bin/
42 install -D -m 644 pl_mop.cron $RPM_BUILD_ROOT/etc/cron.d/pl_mop
45 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
48 %defattr(0755, root, root)
50 /usr/local/planetlab/bin/pl_mom.pl
51 /usr/local/planetlab/bin/pl_mop.sh
58 if [ "$1" -ge 1 ]; then
60 chkconfig --add pl_mom
61 chkconfig --level 3 pl_mom on
63 if [[ "$PL_BOOTCD" != "1" ]]; then
64 /etc/init.d/pl_mom stop
65 /etc/init.d/pl_mom start
68 # Randomize pl_mop run time
69 M=$((60 * $RANDOM / 32768))
70 H=$((24 * $RANDOM / 32768))
71 sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" /etc/cron.d/pl_mop
75 if [ "$1" -eq 0 ]; then
76 if [[ "$PL_BOOTCD" != "1" ]]; then
77 /etc/init.d/pl_mom stop
80 chkconfig --del pl_mom