1 diff -Nur rc-scripts-0.4.0.2.orig/rc.d/init.d/functions rc-scripts-0.4.0.2/rc.d/init.d/functions
2 --- rc-scripts-0.4.0.2.orig/rc.d/init.d/functions 2003-10-02 20:46:49.000000000 +0200
3 +++ rc-scripts-0.4.0.2/rc.d/init.d/functions 2003-10-12 15:50:17.035580952 +0200
8 -# A function to start a program (now it's usefull on read-only filesystem too)
9 +# A function to start a program (now it's useful on read-only filesystem too)
12 - typeset errors="" prog=""
13 + typeset errors="" prog="" limits=""
14 typeset -i exit_code=0
15 [ -z "$DEFAULT_SERVICE_RUN_NICE_LEVEL" ] && DEFAULT_SERVICE_RUN_NICE_LEVEL=0
16 - # Test syntax. Don't use -o instead || here - this will broke ksh --misiek
17 + # "-u unlimited" (-p for ksh) to make sure daemons will be able to fork.
18 + # "-c 0" to make sure it doesn't core dump anywhere; while this could mask
19 + # problems with the daemon, it also closes some security problems.
20 + # Users' limits are set via pam_limits.
21 + [ -z "$DEFAULT_SERVICE_LIMITS" ] && DEFAULT_SERVICE_LIMITS_HARD="-u unlimited -c 0"
22 + # Test syntax. Don't use -o instead || here - this will break ksh --misiek
23 while [ "$1" != "${1##-}" ] || [ "$1" != "${1##+}" ]; do
30 - # make sure it doesn't core dump anywhere; while this could mask
31 - # problems with the daemon, it also closes some security problems
34 - # Make sure daemons will be able to fork.
35 - # Limits are set via pam_limits.
36 if [ -n "$KSH_VERSION" ]; then
38 + limits="`echo ${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS} | sed -e 's/-\([SH]\?\)u/-\1p/'`"
39 elif [ -n "$ZSH_VERSION" ]; then
41 + limits="${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}"
42 elif [ -n "$BASH_VERSION" ]; then
44 + limits="${SERVICE_LIMITS:-$DEFAULT_SERVICE_LIMITS}"
45 # elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
47 + while echo "$limits" | grep -q '[^ ]'; do
48 + ulimit `echo ${limits} | sed -e 's/^ *\(-[^-]*\)\(-.*\)\?$/\1/'`
49 + limits="`echo ${limits} | sed -e 's/^ *\(-[^-]*\)\(-.*\)\?$/\2/'`"
54 diff -Nur rc-scripts-0.4.0.2.orig/sysconfig/system rc-scripts-0.4.0.2/sysconfig/system
55 --- rc-scripts-0.4.0.2.orig/sysconfig/system 2003-10-02 20:46:49.000000000 +0200
56 +++ rc-scripts-0.4.0.2/sysconfig/system 2003-10-12 15:50:53.502037208 +0200
58 # $SERVICE_RUN_NICE_LEVEL is not defined in /etc/sysconfig/<service>
59 DEFAULT_SERVICE_RUN_NICE_LEVEL=0
61 +# Default limits set before running demons (hard and soft) if
62 +# $SERVICE_LIMITS are not defined in /etc/sysconfig/<service>
63 +# Use "-u" for process limits (automatically translated to "-p" for ksh).
64 +# Use "-Sx" or "-Hx" to set only soft or hard "x" limit.
65 +# Advised limits are:
66 +# "-u unlimited" to make sure daemons will be able to fork;
67 +# "-c 0" to make sure it doesn't core dump anywhere; while this could mask
68 +# problems with the daemon, it also closes some security problems;
69 +# users' limits are set via pam_limits.
70 +DEFAULT_SERVICE_LIMITS="-u unlimited -c 0"
72 # Setup PNP using userspace tools?
74 # Setup kernel space PNP (2.4.x)