git://git.onelab.eu
/
mom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initted default limits before connecting to NM for first time in case NM except'ns.
[mom.git]
/
pl_mom.spec
diff --git
a/pl_mom.spec
b/pl_mom.spec
index
4d3fd08
..
ad7035a
100644
(file)
--- a/
pl_mom.spec
+++ b/
pl_mom.spec
@@
-1,12
+1,12
@@
%define name pl_mom
%define name pl_mom
-%define version 0.
3
-%define release
15
%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%define version 0.
4
+%define release
4
%{?pldistro:.%{pldistro}}%{?date:.%{date}}
-Summary: PlanetLab
mom -- Cleans up your mes
s
+Summary: PlanetLab
node monitoring tool
s
Name: %{name}
Version: %{version}
Release: %{release}
Name: %{name}
Version: %{version}
Release: %{release}
-License:
dontknow
+License:
GPL
Group: System Environment/Kernel
Source: %{name}-%{version}.tgz
Vendor: PlanetLab
Group: System Environment/Kernel
Source: %{name}-%{version}.tgz
Vendor: PlanetLab
@@
-15,73
+15,94
@@
Distribution: PlanetLab 3.0
URL: http://cvs.planet-lab.org/cvs/pl_mom
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: expect
URL: http://cvs.planet-lab.org/cvs/pl_mom
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: expect
+# swapmon requires vps and bwlimit.py
+Requires: util-vserver, util-vserver-python
+# bwmon requires tc
+Requires: iproute
%description
%description
+pl_mom is a suite of PlanetLab node monitoring tools.
-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.
+swapmon is a swap monitoring daemon. Every 30 seconds, it checks
+process memory usage. At 90% utilization, resets the slice that is
+consuming the most physical memory. At 95% utilization, it reboots the
+machine to avoid a crash.
-A cron job which "fixes" various common problems with nodes (dead
-s
ervices, ext3 corruption, zombie SSH sessions) is also installed
.
+bwmon is a cron job that monitors the average bandwidth usage of each
+s
lice and enforces a daily byte limit for each slice
.
-%prep
+pl_mop is a cron job that "fixes" various common problems with nodes
+(dead services, ext3 corruption, zombie SSH sessions, etc.).
-%setup
+%prep
+%setup -q
%build
%install
%build
%install
-mkdir -p $RPM_BUILD_ROOT/usr/local/planetlab/bin/
-mkdir -p $RPM_BUILD_ROOT/etc/init.d/
+rm -rf $RPM_BUILD_ROOT
-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/
+# Utility functions
+install -D -m 644 pl_mom.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/pl_mom.py
-install -D -m 644 pl_mop.cron $RPM_BUILD_ROOT/etc/cron.d/pl_mop
+# Bandwidth monitor (bwmon), run periodically
+install -D -m 755 bwmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/bwmon.py
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+# Swap monitoring daemon (swapmon)
+install -D -m 755 swapmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/swapmon.py
+install -D -m 755 swapmon.init $RPM_BUILD_ROOT/%{_initrddir}/swapmon
-%files
-%defattr(0755, root, root)
-/etc/init.d/pl_mom
-/usr/local/planetlab/bin/pl_mom.pl
-/usr/local/planetlab/bin/pl_mop.sh
-/etc/cron.d/pl_mop
+# Cleanup script
+install -D -m 755 pl_mop.sh $RPM_BUILD_ROOT/usr/local/planetlab/bin/pl_mop.sh
+
+# Runs pl_mop and bwmon periodically
+install -D -m 644 pl_mom.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/pl_mom
+
+%clean
+rm -rf $RPM_BUILD_ROOT
%pre
%pre
+if [ "$PL_BOOTCD" != "1" ] ; then
+ service pl_mom stop
+fi
+exit 0
%post
%post
-if [ "$1" -ge 1 ]; then
-
- chkconfig --add pl_mom
- chkconfig --level 3 pl_mom on
+chkconfig --add swapmon
+chkconfig swapmon on
+if [ "$PL_BOOTCD" != "1" ] ; then
+ service swapmon restart
+fi
- if [[ "$PL_BOOTCD" != "1" ]]; then
- /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/" %{_sysconfdir}/cron.d/pl_mom
- # 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
-fi
+exit 0
%preun
%preun
+# 0 = erase, 1 = upgrade
if [ "$1" -eq 0 ]; then
if [ "$1" -eq 0 ]; then
- if [[ "$PL_BOOTCD" != "1" ]]; then
- /etc/init.d/pl_mom stop
- fi
-
- chkconfig --del pl_mom
- chkconfig pl_mom off
+ if [ "$PL_BOOTCD" != "1" ] ; then
+ service swapmon stop
+ fi
+ chkconfig swapmon off
+ chkconfig --del swapmon
fi
fi
+exit 0
-%postun
-
+%files
+%defattr(-, root, root, -)
+%{_datadir}/%{name}/pl_mom.py
+%{_datadir}/%{name}/bwmon.py
+%{_datadir}/%{name}/swapmon.py
+%{_initrddir}/swapmon
+/usr/local/planetlab/bin/pl_mop.sh
+%{_sysconfdir}/cron.d/pl_mom
+%changelog
+* Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu>
+- bwlimit: Use cached values if NM stops responding