Changeset 23154
- Timestamp:
- 03/19/07 11:26:21 (21 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 4 modified
-
launchd.plist.5 (modified) (1 diff)
-
launchd_core_logic.c (modified) (8 diffs)
-
launchd_runtime.c (modified) (2 diffs)
-
liblaunch_public.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd.plist.5
r23095 r23154 196 196 .It Sy QueueDirectories <array of strings> 197 197 Much like the WatchPaths option, this key will watch the paths for modifications. The difference being that the job will only be started if the path is a directory and the directory is not empty. 198 .It Sy StartOnMount <boolean> 199 This optional key causes the job to be started every time a filesystem is mounted. 198 200 .It Sy StartInterval <integer> 199 201 This optional key causes the job to be started every N seconds. -
trunk/launchd/src/launchd_core_logic.c
r23151 r23154 223 223 static void jobmgr_log_stray_children(jobmgr_t jm); 224 224 static void jobmgr_remove(jobmgr_t jm); 225 static void jobmgr_dispatch_all(jobmgr_t jm );225 static void jobmgr_dispatch_all(jobmgr_t jm, bool newmounthack); 226 226 static job_t job_mig_intran2(jobmgr_t jm, mach_port_t p); 227 227 static void job_export_all2(jobmgr_t jm, launch_data_t where); … … 279 279 unsigned int globargv:1, wait4debugger:1, unload_at_exit:1, stall_before_exec:1, only_once:1, 280 280 currently_ignored:1, forced_peers_to_demand_mode:1, setnice:1, hopefully_exits_last:1, removal_pending:1, 281 wait4pipe_eof:1, sent_sigkill:1, debug_before_kill:1, weird_bootstrap:1 ;281 wait4pipe_eof:1, sent_sigkill:1, debug_before_kill:1, weird_bootstrap:1, start_on_mount:1; 282 282 char label[0]; 283 283 }; … … 767 767 768 768 if (j->mgr->global_on_demand_cnt == 0) { 769 jobmgr_dispatch_all(j->mgr );769 jobmgr_dispatch_all(j->mgr, false); 770 770 } 771 771 … … 1090 1090 if (strcasecmp(key, LAUNCH_JOBKEY_SESSIONCREATE) == 0) { 1091 1091 j->session_create = value; 1092 } else if (strcasecmp(key, LAUNCH_JOBKEY_STARTONMOUNT) == 0) { 1093 j->start_on_mount = value; 1092 1094 } 1093 1095 break; … … 1752 1754 1753 1755 void 1754 jobmgr_dispatch_all(jobmgr_t jm )1756 jobmgr_dispatch_all(jobmgr_t jm, bool newmounthack) 1755 1757 { 1756 1758 jobmgr_t jmi, jmn; … … 1758 1760 1759 1761 SLIST_FOREACH_SAFE(jmi, &jm->submgrs, sle, jmn) { 1760 jobmgr_dispatch_all(jmi );1762 jobmgr_dispatch_all(jmi, newmounthack); 1761 1763 } 1762 1764 1763 1765 SLIST_FOREACH_SAFE(ji, &jm->jobs, sle, jn) { 1764 job_dispatch(ji, false);1766 job_dispatch(ji, newmounthack ? ji->start_on_mount : false); 1765 1767 } 1766 1768 } … … 1909 1911 return (void)jobmgr_assumes(jm, false); 1910 1912 } 1913 break; 1914 case EVFILT_FS: 1915 if (kev->fflags & VQ_MOUNT) { 1916 jobmgr_dispatch_all(jm, true); 1917 } 1918 jobmgr_dispatch_all_semaphores(jm); 1911 1919 break; 1912 1920 case EVFILT_TIMER: … … 3504 3512 if (!jm) { 3505 3513 jobmgr_assumes(jmr, kevent_mod(SIGTERM, EVFILT_SIGNAL, EV_ADD, 0, 0, jmr) != -1); 3514 jobmgr_assumes(jmr, kevent_mod(0, EVFILT_FS, EV_ADD|EV_CLEAR, VQ_MOUNT|VQ_UNMOUNT|VQ_UPDATE, 0, jmr) != -1); 3506 3515 } 3507 3516 -
trunk/launchd/src/launchd_runtime.c
r23124 r23154 43 43 #include <sys/mount.h> 44 44 #include <sys/reboot.h> 45 #include <sys/fcntl.h> 45 46 #include <bsm/libbsm.h> 46 47 #include <malloc/malloc.h> … … 889 890 record_caller_creds(&bufRequest->Head); 890 891 892 /* 893 * This is a total hack. We really need a bit in the kernel's proc 894 * struct to declare our intent. 895 */ 896 static int no_hang_fd = -1; 897 if (no_hang_fd == -1) { 898 no_hang_fd = _fd(open("/dev/autofs_nowait", 0)); 899 } 900 891 901 if (the_demux(&bufRequest->Head, &bufReply->Head) == FALSE) { 892 902 /* XXX - also gross */ -
trunk/launchd/src/liblaunch_public.h
r23042 r23154 82 82 #define LAUNCH_JOBKEY_LOWPRIORITYIO "LowPriorityIO" 83 83 #define LAUNCH_JOBKEY_SESSIONCREATE "SessionCreate" 84 #define LAUNCH_JOBKEY_STARTONMOUNT "StartOnMount" 84 85 #define LAUNCH_JOBKEY_SOFTRESOURCELIMITS "SoftResourceLimits" 85 86 #define LAUNCH_JOBKEY_HARDRESOURCELIMITS "HardResourceLimits"

