git://git.onelab.eu
/
mom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67cc768
)
- install pl_mop job
author
Mark Huang
<mlhuang@cs.princeton.edu>
Tue, 11 Oct 2005 17:35:10 +0000
(17:35 +0000)
committer
Mark Huang
<mlhuang@cs.princeton.edu>
Tue, 11 Oct 2005 17:35:10 +0000
(17:35 +0000)
pl_mom.spec
patch
|
blob
|
history
diff --git
a/pl_mom.spec
b/pl_mom.spec
index
4810d84
..
e7c291a
100644
(file)
--- a/
pl_mom.spec
+++ b/
pl_mom.spec
@@
-1,6
+1,6
@@
%define name pl_mom
%define version 0.3
%define name pl_mom
%define version 0.3
-%define release
9
.planetlab%{?date:.%{date}}
+%define release
10
.planetlab%{?date:.%{date}}
Summary: PlanetLab mom -- Cleans up your mess
Name: %{name}
Summary: PlanetLab mom -- Cleans up your mess
Name: %{name}
@@
-14,6
+14,7
@@
Packager: PlanetLab Central <support@planet-lab.org>
Distribution: PlanetLab 3.0
URL: http://cvs.planet-lab.org/cvs/pl_mom
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Distribution: PlanetLab 3.0
URL: http://cvs.planet-lab.org/cvs/pl_mom
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: expect
%description
%description
@@
-21,6
+22,9
@@
A small daemon that watches the consumed swap space. At 90% utilization, it
resets the slice that is the biggest memory hog. At 95% utilization, it
reboots the machine.
resets the slice that is the biggest memory hog. At 95% utilization, it
reboots the machine.
+A cron job which "fixes" various common problems with nodes (dead
+services, ext3 corruption, zombie SSH sessions) is also installed.
+
%prep
%setup
%prep
%setup
@@
-33,6
+37,9
@@
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
cp pl_mom $RPM_BUILD_ROOT/etc/init.d/
cp pl_mom.pl $RPM_BUILD_ROOT/usr/local/planetlab/bin/
cp pl_mom $RPM_BUILD_ROOT/etc/init.d/
cp pl_mom.pl $RPM_BUILD_ROOT/usr/local/planetlab/bin/
+cp pl_mop.sh $RPM_BUILD_ROOT/usr/local/planetlab/bin/
+
+install -D -m 644 pl_mop.cron $RPM_BUILD_ROOT/etc/cron.d/pl_mop.cron
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@@
-41,6
+48,7
@@
cp pl_mom.pl $RPM_BUILD_ROOT/usr/local/planetlab/bin/
%defattr(0755, root, root)
/etc/init.d/pl_mom
/usr/local/planetlab/bin/pl_mom.pl
%defattr(0755, root, root)
/etc/init.d/pl_mom
/usr/local/planetlab/bin/pl_mom.pl
+/usr/local/planetlab/bin/pl_mop.sh
%pre
%pre
@@
-55,6
+63,11
@@
if [ "$1" -ge 1 ]; then
/etc/init.d/pl_mom stop
/etc/init.d/pl_mom start
fi
/etc/init.d/pl_mom stop
/etc/init.d/pl_mom start
fi
+
+ # Randomize pl_mop run time
+ M=$((60 * $RANDOM / 32768))
+ H=$((24 * $RANDOM / 32768))
+ sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" /etc/cron.d/pl_mop.cron
fi
%preun
fi
%preun