Hi Cole and Andre, just chirping in in case you are drafting a PreCmd/PostCmd replacement.For admin purposes, I would find a sidecar job quite handy, i.e., a lightweight process that an admin could spawn in parallel to each job - like for monitoring purposes. Ideally, such a sidecar could be in a job's scope in a dedicated sub-scope and being execed under a different user context than the actual job as to isolate the sidecar from interference from the payload job. Instead of doing the exec and listening for SIGCHILD itself (or doing ptrace...), a sidecar job could use a thin eBPF tracepoint shim program, which could listen for relevant signals to the payload job and notify the sidecar in userland (or maybe alternatively polling just for the payload job's exit with pidfd_open() ).
Cheers, Thomas
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature