title: Get notified about process termination
body: <p>I’m trying to use NETLINK with CN_IDX_PROC to monitor my process. This works but requires the monitoring process to be launched with root privileges.</p>
  
  <p>I’ve tried to fix it by setting a capability in the filesystem on my monitoring executable (including CAP_AUDIT_READ, CAP_SYS_ADMIN,CAP_SYS_PTRACE and CAP_IPC_OWNER), but it didn’t work, bind() still fails saying “Operation not permitted” unless using <code>sudo</code> to start.</p>
  
  <p>Is there a way to enable non-roots to use netlink connector sockets the way I want?</p>
  
  <p>If no, is there any other reliable way to get notified when other (non child, running under different user account) process terminates? I don’t want to poll: it’s embedded software, I don’t have much resources, and I want to get notified ASAP. I especially want to get notified if the target process terminates abnormally, e.g. with segmentation fault, so I can’t rely on target process being cooperative.</p>
  
  <p>On Windows I’d just create &amp; lock a named mutex in the target process, and make the monitor process to sleep on it, mutexes are guaranteed to be released as soon as the owner process dies. Is there a similar IPC mechanism in Linux?</p>