Open Gbury opened 9 years ago
+1 for this feature, this is often needed.
This is actually pretty much the same as issue #29 . My current plan would be to use "obus" to access the systemd API, and use that internally to limit processes launched in frogutils. From what i remember, we could avoid a hard dependency on obus, as its main use is to generate files to allow direct access to dbus APIs.
obus is a mess, imho. Even cgroups would be simpler…
The problem is that at medium term, the cgroups API will move from the filesystem to systemd. Obus is one way to interact with systemd without too much headache. If you have another suggestion, I'm all ears.
Your ctypes bindings are not future-proof?
I don't use ctypes bindings, :p Originally, the only way to access the cgroups API was through the filesystem (the C libraries out there also have to go through the filesystem), and so it is what I implemented in my ocaml package (there really was not much benefit to go through a C library). However, it raises some problems concerning permissions, so there is now a systemd API, which should become the only one in the future (possibly removing the filesystem API at one time).
It could be nice to have a new tool for imposing limits to a program. Using
ulimit
as is done currently is fine, but it has a few flaws:Additionally, froglimit could behave in a way similar to that used in the CASC competition (e.g sending
SIGALRM
and/orSIGXCPU
when a process timeouts), which could be nice.