Add bwlimit and cpulimit modules to Python RPM
[util-vserver.git] / util-vserver.spec
index 544ab93..11ffebc 100644 (file)
@@ -1,14 +1,12 @@
 %define name util-vserver
 %define version 0.30
-%define release 4.planetlab%{?date:.%{date}}
+%define release 14.planetlab%{?date:.%{date}}
 
 Vendor: PlanetLab
 Packager: PlanetLab Central <support@planet-lab.org>
 Distribution: PlanetLab 3.0
 URL: http://cvs.planet-lab.org/cvs/util-vserver
 
-%define __chattr       /usr/bin/chattr
-
 Summary:       Linux virtual server utilities
 Name:          %{name}
 Version:       %{version}
@@ -23,7 +21,6 @@ Provides:     vserver = %epoch:%version-%release
 Conflicts:     vserver < %epoch:%version-%release
 Conflicts:     vserver > %epoch:%version-%release
 BuildRequires: e2fsprogs-devel
-Requires(post):        %__chattr
 
 %package linuxconf
 Summary:       Linuxconf administration modules for vservers
@@ -78,36 +75,36 @@ ln -f ${RPM_BUILD_ROOT}%_sbindir/vsh ${RPM_BUILD_ROOT}/bin/vsh
 
 install -D -m 644 sysv/vcached.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/vcached
 
+mkdir -p $RPM_BUILD_ROOT/etc/cron.d
+. sysv/vcached.conf
+echo "*/$(($period / 60)) * * * * root %_sbindir/vcached -s -f -l $logfile" > $RPM_BUILD_ROOT/etc/cron.d/vcached
+
+%__make -C python INSTALL_ROOT=$RPM_BUILD_ROOT install
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%define services vcached vservers
-
 %pre
 # 1 = install, 2 = upgrade/reinstall
 if [ $1 -eq 2 ] ; then
-    for i in %{services} ; do
-       [ "`/sbin/runlevel`" = "unknown" ] || service $i stop || :
-    done
+    # vcached no longer runs as a daemon
+    [ "`/sbin/runlevel`" = "unknown" ] || service vcached stop || :
 fi
 
 %post
-# 1 = install, 2 = upgrade/reinstall
-if [ $1 -eq 1 ] ; then
-    for i in %{services} ; do
-       chkconfig --add $i
-       chkconfig $i on
-    done
-fi
-for i in %{services} ; do
-    [ "`/sbin/runlevel`" = "unknown" ] || service $i start
-done
+# vcached no longer runs as a daemon
+chkconfig vcached off
+chkconfig --del vcached
+
+chkconfig --add vservers
+chkconfig vservers on
+
 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
     echo /bin/vsh >> /etc/shells
 fi
 
-%__chattr +t /vservers || :
-
+# make sure barrier bit is set on /vservers to prevent chroot() escapes
+%_libdir/%name/setattr --barrier /vservers
 
 %postun
 # 0 = erase, 1 = upgrade
@@ -118,11 +115,9 @@ fi
 %preun
 # 0 = erase, 1 = upgrade
 if [ $1 -eq 0 ] ; then
-    for i in %{services} ; do
-       [ "`/sbin/runlevel`" = "unknown" ] || service $i stop || :
-       chkconfig $i off
-       chkconfig --del $i
-    done
+    [ "`/sbin/runlevel`" = "unknown" ] || service vservers stop
+    chkconfig vservers off
+    chkconfig --del vservers
 fi
 
 %files
@@ -137,6 +132,7 @@ fi
 %config(noreplace) /etc/vservers.conf
 %config(noreplace) /etc/vcached.conf
 /etc/logrotate.d/vcached
+/etc/cron.d/vcached
 %dir /etc/vservers
 %attr(0,root,root) %dir /vservers
 %attr(4755,root,root) /usr/sbin/vsh
@@ -151,8 +147,80 @@ fi
 %_sbindir/newvserver
 %_mandir/man8/newvserver*
 
+
+
+%package py23
+Summary: Python modules for manipulating vservers
+Group: Applications/System
+Requires: python /usr/lib/util-vserver/util-vserver-vars util-python
+
+%description py23
+Python modules for manipulating vservers.  Provides a superset of the
+functionality of the vserver script (at least will do in the future),
+but more readily accessible from Python code.
+
+%files py23
+%defattr(0644,root,root)
+/usr/lib/python2.3/site-packages/bwlimit.py
+/usr/lib/python2.3/site-packages/bwlimit.pyc
+/usr/lib/python2.3/site-packages/cpulimit.py
+/usr/lib/python2.3/site-packages/cpulimit.pyc
+/usr/lib/python2.3/site-packages/util_vserver_vars.py
+/usr/lib/python2.3/site-packages/vduimpl.so
+/usr/lib/python2.3/site-packages/vserver.py
+/usr/lib/python2.3/site-packages/vserver.pyc
+/usr/lib/python2.3/site-packages/vserverimpl.so
+
+
+
 %changelog
-* Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu> 0.1-1.planetlab
+* Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
+- add bwlimit and cpulimit modules
+
+* Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
+- import Marc's vdu implementation
+
+* Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
+- 'vserver-init start' functionality subsumed by Node Manager
+
+* Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
+- Fixed vlimit command
+
+* Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
+- add Python modules for manipulating vservers
+
+* Thu Apr  7 2005 Steve Muir <smuir@cs.princeton.edu>
+- vuserdel changes: don't shutdown vserver, just kill all processes;
+  unmount all mountpoints in vserver before deleting
+
+* Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
+- vcached no longer runs as a daemon
+- do not restart vservers when package is upgraded
+
+* Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
++ planetlab-3_0-rc4
+- PL2445
+- Both vcached and vuseradd now print a warning message when vbuild
+  succeeds but the resulting new vserver image is smaller in size than
+  the vserver-reference image.
+- vuseradd: clean up some more junk on failure
+
+* Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
++ planetlab-3_0-rc3
+- PL3026: This is the upgraded version of vdu that maintains an
+  internal hash table of files with a nlink count > 1.  Only if vdu
+  sees all hard links to a particular inode does it add its size and
+  block count to the total.
+
+* Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
+- PL2445 Use -b option to du to avoid rounding errors.
+
+* Sat Nov  6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
++ planetlab-3_0-rc2
+- don't create the symbolic link /home/slice/.ssh, this is not how
+  pl_sshd works
+
+* Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
 - added vsh
 
 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab