OpenRC / openrc

The OpenRC init system
BSD 2-Clause "Simplified" License
1.45k stars 245 forks source link

look into using setrlimit() to set resource limits instead of the ulimit shell builtin #399

Open williamh opened 3 years ago

williamh commented 3 years ago

Currently, we use the rc_ulimit variable as an argument to the ulimit shell builtin to set resource limits. This method is not portable because it relies on a builtin which has different options based on whether the shell is posix or not. The way around this is to use the setrlimit() system call directly in start-stop-daemon and supervise-daemon.

orlitzky commented 3 years ago

The contents of $rc_ulimit get passed to ulimit once, which also means that you can never set more than one limit with the dash shell because it only supports setting one limit at a time.

TheAifam5 commented 2 years ago

Having same issue on Gentoo. :/ Any known solution for that? Pretty annoying and basically no error message or anything which could point to that issue took me a great amount of time to get me here.