)]}'
{
  "commit": "ebec18a6d3aa1e7d84aab16225e87fd25170ec2b",
  "tree": "fd329dcd5173c252fc7aed64cab9c2a51575dcec",
  "parents": [
    "953326cb60c1dff1bd3458d6468d16d75f2bcd61"
  ],
  "author": {
    "name": "Lennart Poettering",
    "email": "lennart@poettering.net",
    "time": "Fri Mar 23 15:01:54 2012 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Fri Mar 23 16:58:32 2012 -0700"
  },
  "message": "prctl: add PR_{SET,GET}_CHILD_SUBREAPER to allow simple process supervision\n\nUserspace service managers/supervisors need to track their started\nservices.  Many services daemonize by double-forking and get implicitly\nre-parented to PID 1.  The service manager will no longer be able to\nreceive the SIGCHLD signals for them, and is no longer in charge of\nreaping the children with wait().  All information about the children is\nlost at the moment PID 1 cleans up the re-parented processes.\n\nWith this prctl, a service manager process can mark itself as a sort of\n\u0027sub-init\u0027, able to stay as the parent for all orphaned processes\ncreated by the started services.  All SIGCHLD signals will be delivered\nto the service manager.\n\nReceiving SIGCHLD and doing wait() is in cases of a service-manager much\npreferred over any possible asynchronous notification about specific\nPIDs, because the service manager has full access to the child process\ndata in /proc and the PID can not be re-used until the wait(), the\nservice-manager itself is in charge of, has happened.\n\nAs a side effect, the relevant parent PID information does not get lost\nby a double-fork, which results in a more elaborate process tree and\n\u0027ps\u0027 output:\n\nbefore:\n  # ps afx\n  253 ?        Ss     0:00 /bin/dbus-daemon --system --nofork\n  294 ?        Sl     0:00 /usr/libexec/polkit-1/polkitd\n  328 ?        S      0:00 /usr/sbin/modem-manager\n  608 ?        Sl     0:00 /usr/libexec/colord\n  658 ?        Sl     0:00 /usr/libexec/upowerd\n  819 ?        Sl     0:00 /usr/libexec/imsettings-daemon\n  916 ?        Sl     0:00 /usr/libexec/udisks-daemon\n  917 ?        S      0:00  \\_ udisks-daemon: not polling any devices\n\nafter:\n  # ps afx\n  294 ?        Ss     0:00 /bin/dbus-daemon --system --nofork\n  426 ?        Sl     0:00  \\_ /usr/libexec/polkit-1/polkitd\n  449 ?        S      0:00  \\_ /usr/sbin/modem-manager\n  635 ?        Sl     0:00  \\_ /usr/libexec/colord\n  705 ?        Sl     0:00  \\_ /usr/libexec/upowerd\n  959 ?        Sl     0:00  \\_ /usr/libexec/udisks-daemon\n  960 ?        S      0:00  |   \\_ udisks-daemon: not polling any devices\n  977 ?        Sl     0:00  \\_ /usr/libexec/packagekitd\n\nThis prctl is orthogonal to PID namespaces.  PID namespaces are isolated\nfrom each other, while a service management process usually requires the\nservices to live in the same namespace, to be able to talk to each\nother.\n\nUsers of this will be the systemd per-user instance, which provides\ninit-like functionality for the user\u0027s login session and D-Bus, which\nactivates bus services on-demand.  Both need init-like capabilities to\nbe able to properly keep track of the services they start.\n\nMany thanks to Oleg for several rounds of review and insights.\n\n[akpm@linux-foundation.org: fix comment layout and spelling]\n[akpm@linux-foundation.org: add lengthy code comment from Oleg]\nReviewed-by: Oleg Nesterov \u003coleg@redhat.com\u003e\nSigned-off-by: Lennart Poettering \u003clennart@poettering.net\u003e\nSigned-off-by: Kay Sievers \u003ckay.sievers@vrfy.org\u003e\nAcked-by: Valdis Kletnieks \u003cValdis.Kletnieks@vt.edu\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a0413ac3abe86db4fed4cdc003c2493e0438fe2d",
      "old_mode": 33188,
      "old_path": "include/linux/prctl.h",
      "new_id": "e0cfec2490aaeeeb73f234646e9e4806afaf148c",
      "new_mode": 33188,
      "new_path": "include/linux/prctl.h"
    },
    {
      "type": "modify",
      "old_id": "0c147a4260a51b47e79e347d9aa4239969a5d638",
      "old_mode": 33188,
      "old_path": "include/linux/sched.h",
      "new_id": "0c3854b0d4b180670563c461c8d0feaf4bd96c3a",
      "new_mode": 33188,
      "new_path": "include/linux/sched.h"
    },
    {
      "type": "modify",
      "old_id": "16b07bfac224d3f13960b09502fbecfba8897db0",
      "old_mode": 33188,
      "old_path": "kernel/exit.c",
      "new_id": "456329fd4ea35cff20cd10b082497e7e4088b4ab",
      "new_mode": 33188,
      "new_path": "kernel/exit.c"
    },
    {
      "type": "modify",
      "old_id": "37674ec55cde19d12e3deda5845ecb1b8b4d376c",
      "old_mode": 33188,
      "old_path": "kernel/fork.c",
      "new_id": "b9372a0bff18c2a042cb4ef7f6d6ea7b25a3583c",
      "new_mode": 33188,
      "new_path": "kernel/fork.c"
    },
    {
      "type": "modify",
      "old_id": "888d227fd19599becd391eee8c35f96601b6bfc2",
      "old_mode": 33188,
      "old_path": "kernel/sys.c",
      "new_id": "9eb7fcab8df622cdc1ad7fa032963324b777e982",
      "new_mode": 33188,
      "new_path": "kernel/sys.c"
    }
  ]
}
