Minor changes for PlanetLab V3
authorAndy Bavier <acb@cs.princeton.edu>
Wed, 17 Nov 2004 20:24:11 +0000 (20:24 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Wed, 17 Nov 2004 20:24:11 +0000 (20:24 +0000)
Makefile
README.txt
pl_mom.spec [new file with mode: 0644]

index bd39bb3..dfe3e77 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 # @COPYRIGHT@
 #
-# $Id: Makefile,v $
+# $Id: Makefile,v 1.1.1.1 2004/10/29 18:03:29 acb Exp $
 
-BASE=pl_dod
+BASE=pl_mom
 VERSION=0.2
 TARFILE=$(BASE)-$(VERSION).tgz
 
index 579d948..cf11831 100644 (file)
@@ -29,7 +29,7 @@ if there are thousands of processes on the machine).
 Building
 ---------
 
-Rename the parent directory from pl_mom to pl_dod-0.2 (or whatever is
+Rename the parent directory from pl_mom to pl_mom-0.2 (or whatever is
 the appropriate version number listed in the Makefile).  Then "make
 rpm" should do it.
 
@@ -37,9 +37,3 @@ rpm" should do it.
 Notes
 ------
 
-The name of the daemon is "pl_mom" but the package name is pl_dod.
-The reason is that the daemon and package were both originally called
-pl_dod.  Yum (the package management tool currently in use) does
-not seem to honor the "Obsoletes:" tag in the .spec file.  Therefore
-it was not possible to automatically update the old pl_dod package
-with a new one called pl_mom, and so the package kept the old name.
diff --git a/pl_mom.spec b/pl_mom.spec
new file mode 100644 (file)
index 0000000..44ea666
--- /dev/null
@@ -0,0 +1,74 @@
+%define name pl_mom
+%define version 0.2
+%define release 16.planetlab%{?date:.%{date}}
+Summary: PlanetLab mom -- Cleans up your mess
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Copyright: dontknow
+Group: System Environment/Kernel
+Source: %{name}-%{version}.tgz
+Vendor: PlanetLab
+Packager: PlanetLab Central <support@planet-lab.org>
+Distribution: PlanetLab 2.0
+URL: http://www.planet-lab.org
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+%description
+
+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.
+
+%prep
+
+%setup
+
+%build
+
+%install
+mkdir -p $RPM_BUILD_ROOT/usr/local/planetlab/bin/
+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/
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(0755, root, root)
+/etc/init.d/pl_mom
+/usr/local/planetlab/bin/pl_mom.pl
+
+%pre
+
+
+%post 
+RUNLEVEL=`/sbin/runlevel`
+
+if [ "$1" -ge 1 ]; then
+
+        chkconfig --add pl_mom
+        chkconfig --level 3 pl_mom on
+
+        if [[ "$RUNLEVEL" != "unknown" ]]; then
+                /etc/init.d/pl_mom stop
+                /etc/init.d/pl_mom start
+        fi
+fi
+
+%preun
+RUNLEVEL=`/sbin/runlevel`
+
+if [ "$1" -eq 0 ]; then
+        if [[ "$RUNLEVEL" != "unknown" ]]; then
+                /etc/init.d/pl_mom stop
+        fi
+fi
+
+
+%postun
+
+