File ulimit.spec of Package ulimit

#
# spec file for package ulimit (Version 1.2)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           ulimit
License:        Artistic License
Group:          System/Base
AutoReqProv:    on
Summary:        Set system-wide per-process limits (rlimits)
Version:        1.2
Release:        1
Source:         %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
PreReq:         %fillup_prereq

%description
The file /etc/initscript is used by init to execute the commands in
/etc/inittab. As any process it started from init, it is a convenient
place to adjust per process limits (rlimits).

The script provided here does set limits on the memory usage per
process (amongst setting other limits) and thus prevents that a single
process that leaks memory can cause your system to run out of memory
and provoke the system to crawl (trash on the swap partition) before it
rescues itself by killing processes (but unfortunately does not always
hit the right process with the first try). The script sets the limits
in percent of available memory, thus the defaults may match a large
range of systems.

Configuration is done in file /etc/sysconfig/ulimit.

Per user rlimit settings can be configured by filling in
/etc/security/limits.conf and using the pam_limits.so functionality.

More finegrained resource management (per process group), can be done
via control groups (containers) with SLE11/openSUSE11.1 or newer.



Authors:
--------
    Kurt Garloff <garloff@suse.de>

%prep
%setup -n ulimit

%build
# nothing to be done

%install
install -d $RPM_BUILD_ROOT/etc
install initscript $RPM_BUILD_ROOT/etc/initscript
install -d $RPM_BUILD_ROOT/var/adm/fillup-templates
install sysconfig.ulimit $RPM_BUILD_ROOT/var/adm/fillup-templates/

%files
%defattr(-,root,root)
%config /etc/initscript
/var/adm/fillup-templates/sysconfig.ulimit

%post
%{fillup_only ulimit}

%clean
if test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/"; then rm -rf $RPM_BUILD_ROOT; fi
rm -rf $RPM_BUILD_DIR/ulimit

%changelog
* Mon Oct 27 2008 garloff@suse.de
- ulimit-1.2:
  * Allow unlimited limits (bnc 382908, bnc 375673)
  * Allow absolute memory limits
  * Refactor (shorten file significantly and clean up environment)
  * Document changes in sysconfig.ulimit file
  * Much more conservative locked memory defaults (still more than
  the kernel default).
* Tue Aug 14 2007 garloff@suse.de
- sysconfig Path missed a colon (299847)
* Sat Jan 20 2007 garloff@suse.de
- Make robust against existing and empty /proc/meminfo (227742)
  (and avoid forks for sed at the same time)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Nov 28 2005 garloff@suse.de
- Fix comment for the stack limit (#132902).
* Fri Apr 01 2005 garloff@suse.de
- Make script work with both pre- and post 2.6.8 kernels. (#74085)
* Sat Mar 26 2005 garloff@suse.de
- Adapt order of applying soft vs hard limits to peculiar 2.6
  requirements for all limits. (#74085, #49323, #60650)
* Sat Mar 26 2005 garloff@suse.de
- Use eval exec "$4" to invoke binary (#74221, #60650).
* Fri Sep 24 2004 garloff@suse.de
- Don't set a limit for locked mem by default. Triggers warning
  with latest 2.6.9-rc kernels. (#SUSE45650)
- Document that the stack limit should not be set either, as
  NPTL uses this a stack size for multithreade programs.
* Sun Mar 28 2004 garloff@suse.de
- Kernel 2.6 needs the soft limits before the hard ones. (#SUSE34323)
* Fri Feb 06 2004 hmacht@suse.de
- building as non root (#norootforbuild)
* Fri Aug 15 2003 garloff@suse.de
- Remove left-over debug output to /tmp
- Specify Command: killall mingetty to restart some service using
  the new limits. (We miss sshd and xdm.)
* Tue Aug 12 2003 garloff@suse.de
- Update to 1.1: Collect arguments first to reduce the number of
  calls to ulimit. (Performance improvement.)
* Sat Aug 09 2003 garloff@suse.de
- Creation of SuSE package.
openSUSE Build Service is sponsored by