Hello!
I've recognized a strange behavior of setrlimit in VPS. I've a Script which limits some Usage of processes
unless (setrlimit(RLIMIT_CPU, 50, 50) ) {
print STDERR "Cannot set RLIMIT_CPU!\n";
exit;
}
unless (setrlimit(RLIMIT_NPROC, 40, 40) ) {
print STDERR "Cannot set RLIMIT_NPROC!\n";
exit;
}
unless (setrlimit(RLIMIT_NOFILE, 50, 50) ) {
print STDERR "Cannot set RLIMIT_OPEN_MAX!\n";
exit;
}
unless (setrlimit(RLIMIT_OPEN_MAX, 50, 50) ) {
print STDERR "Cannot set RLIMIT_OPEN_MAX!\n";
exit;
}
unless (setrlimit(RLIMIT_DATA, 1024*1024*30, 1024*1024*30) ) {
print STDERR "Can not extend data segment limit!\n";
exit;
}
unless (setpriority(0, 10)) {
print STDERR "Cannot set Priority!\n";
exit;
}
....
START EXTERNAL BASH SCRIPT
This code works fine on a 1:1 Image of the VPS without OpenVZ / as running with a vanilla 2.6.25.4 Linux Kernel.
As a OpenVZ VPS i always got: "bash: xmalloc: ../bash/locale.c:68: cannot allocate 2 bytes (0 bytes allocated)" from the EXTERNAL Bash Script.
I've to rise up the "RLIMIT_DATA" up to 1024*1024*250 - then it works in VPS.
user_beancounters does not show any failures. Any ideas?
Thanks for help ideas or something else.
Stefan