/etc/initscript sets soft and hard limits in wrong order


I’ve already entered it into BugZilla, however, the fix is easy and can be of help to quite a few of us so I put it here, too.

The /etc/initscript sets the soft and hard limits of the system in wrong order. Symptom: e.g. try to set the soft file descriptor limit to 5000 and in the boot process /etc/initscript sends an error message:
“/etc/initscript: line 94: ulimit: open files: cannot modify limit: Invalid argument”

The actual error is that the soft limits tried to be set before the hard limits.

Solution: set the two lines (Line 94 and 95 in openSUSE 11.2) of /etc/initscript into this order:
test -z “$HARGS” || ulimit $HARGS
test -z “$SARGS” || ulimit $SARGS

and limit settings start to work normally.