Closed christf closed 6 years ago
there is still no synchronisation done between executions of the hook. We can try getting away with delegating this to the hook itself.
Yeah, delegating this sounds like a reasonable first step. Leave a TODO comment in the code for that, I will have a test on this pr as soon as I find the time.
The crashes indeed are gone now. With the latest patch I can see the events triggering on a local machine, yet have to try this in the gluon environment.
How about using exit() in the child process?
the child process will exit automatically due to execle and the shell exiting when the script ends. We have to make sure to reap the process, which is what wait() does. This will remove the entry from the process table and free the remaining held resources.
Yes it does that, except in the case when the execution of the new process image fails.
if it fails, the process still exits - how would that change things?
No, if there is something utterly going wrong than the child process is keep going. Bad example:
$ cat test.c
#include <unistd.h>
#include <stdio.h>
void main(){
execle("/bin/not-there","not-there",NULL,NULL);
printf("Pong\n");
}
$ ./a.out
Pong
So according to the man page that's normal behaviour, whenever something is going wrong.
Thanks for the help, I appreciate it
without this the hook will not be executed if configured. Also an empty hook will be executed.