[launchd-changes] [23406] trunk/launchd/src
source_changes at macosforge.org
source_changes at macosforge.org
Tue Sep 18 12:26:58 PDT 2007
Revision: 23406
http://trac.macosforge.org/projects/launchd/changeset/23406
Author: zarzycki at apple.com
Date: 2007-09-18 12:26:53 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
A new job attribute: AbandonProcessGroup
Modified Paths:
--------------
trunk/launchd/src/launchd.plist.5
trunk/launchd/src/launchd_core_logic.c
trunk/launchd/src/liblaunch_public.h
Modified: trunk/launchd/src/launchd.plist.5
===================================================================
--- trunk/launchd/src/launchd.plist.5 2007-09-18 18:28:04 UTC (rev 23405)
+++ trunk/launchd/src/launchd.plist.5 2007-09-18 19:26:53 UTC (rev 23406)
@@ -278,6 +278,11 @@
This optional key specifies what
.Xr nice 3
value should be applied to the daemon.
+.It Sy AbandonProcessGroup <boolean>
+When a job dies,
+.Nm launchd
+kills any remaining processes with the same process group ID as the job.
+Setting this key to true disables that behavior.
.It Sy HopefullyExitsFirst <boolean>
This optional key causes programs to exit earlier during system shutdown.
This key exists because some jobs do more than flush buffers and exit like
Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c 2007-09-18 18:28:04 UTC (rev 23405)
+++ trunk/launchd/src/launchd_core_logic.c 2007-09-18 19:26:53 UTC (rev 23406)
@@ -359,7 +359,7 @@
unsigned int globargv:1, wait4debugger:1, unload_at_exit:1, stall_before_exec:1, only_once:1,
currently_ignored:1, forced_peers_to_demand_mode:1, setnice:1, hopefully_exits_last:1, removal_pending:1,
wait4pipe_eof:1, sent_sigkill:1, debug_before_kill:1, weird_bootstrap:1, start_on_mount:1,
- per_user:1, hopefully_exits_first:1, deny_unknown_mslookups:1, unload_at_mig_return:1;
+ per_user:1, hopefully_exits_first:1, deny_unknown_mslookups:1, unload_at_mig_return:1, abandon_pg:1;
const char label[0];
};
@@ -1223,6 +1223,13 @@
bool found_key = false;
switch (key[0]) {
+ case 'a':
+ case 'A':
+ if (strcasecmp(key, LAUNCH_JOBKEY_ABANDONPROCESSGROUP) == 0) {
+ j->abandon_pg = value;
+ found_key = true;
+ }
+ break;
case 'k':
case 'K':
if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE) == 0) {
@@ -1970,7 +1977,9 @@
* instead of ESRCH. As luck would have it, ESRCH is the only
* error we can ignore.
*/
- killpg(j->p, SIGKILL);
+ if (!j->abandon_pg) {
+ killpg(j->p, SIGKILL);
+ }
/*
* 5020256
Modified: trunk/launchd/src/liblaunch_public.h
===================================================================
--- trunk/launchd/src/liblaunch_public.h 2007-09-18 18:28:04 UTC (rev 23405)
+++ trunk/launchd/src/liblaunch_public.h 2007-09-18 19:26:53 UTC (rev 23406)
@@ -98,6 +98,7 @@
#define LAUNCH_JOBKEY_PID "PID"
#define LAUNCH_JOBKEY_THROTTLEINTERVAL "ThrottleInterval"
#define LAUNCH_JOBKEY_LAUNCHONLYONCE "LaunchOnlyOnce"
+#define LAUNCH_JOBKEY_ABANDONPROCESSGROUP "AbandonProcessGroup"
#define LAUNCH_JOBINETDCOMPATIBILITY_WAIT "Wait"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070918/b91ef1ab/attachment.html
More information about the launchd-changes
mailing list