[systemd-devel] UDEV popen/system returns error if called from the program (RUN option)

Ilya Matveychikov matvejchikov at gmail.com
Sun Mar 1 21:35:48 UTC 2020


Hey guys,

I’m not sure is it the right place to ask about the UDEV or not.

Anyways, I have a problem with running custom program from the UDEV rule (RUN+= option).
The problem is somehow related to fork/exec, I can’t tell for sure.

My code (this custom “RUN+=“-binary) using popen() to call external program
and get the result using stream. Once I run this custom program alone it works
perfectly well. But once it is executed under the systemd/udev via the rule
this popen() returns error with the code ENOMEM which is very strange for me
as the system has like 32Gb of RAM.

The same happen with system() ...

Do you guys have any glue of what the heck is going on?
Are there any constraints on what can be done in “programs”?

Ilya.



More information about the systemd-devel mailing list