From e35960f004a9666f7f36582ef70307ceeb880d7a Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Wed, 17 Nov 2004 20:24:11 +0000 Subject: [PATCH] Minor changes for PlanetLab V3 --- Makefile | 4 +-- README.txt | 8 +----- pl_mom.spec | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 pl_mom.spec diff --git a/Makefile b/Makefile index bd39bb3..dfe3e77 100644 --- 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 diff --git a/README.txt b/README.txt index 579d948..cf11831 100644 --- a/README.txt +++ b/README.txt @@ -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 index 0000000..44ea666 --- /dev/null +++ b/pl_mom.spec @@ -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 +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 + + -- 2.43.0