incron icon indicating copy to clipboard operation
incron copied to clipboard

use execl() instead of system() as possible fix for #52

Open philfry opened this issue 5 years ago • 0 comments

Hi, I'm also afflicted with #52. The problem only occurs with system incronjobs, while user incrontabs are not affected. In UserTable::OnEvent(…) these type of incronjobs are handled differently. Incrond fork()s and handles the logic in the child process. User incrontabs are invoked by jumping to UserTable::RunAsUser(…) which runs the specified command by execlp()ing, replacing the child process. System incrontabs' commands are run using system() which is basically another fork() and an execl() – leading to another child process and keeping the first child alive. By replacing system() with execl() the first child should be replaced by the desired command and no additional incrond-processes should show up. Please correct me if I'm wrong.

philfry avatar Mar 14 '19 15:03 philfry