{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/4111","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/4111/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/4111/comments","events_url":"https://api.github.com/repos/chef/chef/issues/4111/events","html_url":"https://github.com/chef/chef/pull/4111","id":113696657,"number":4111,"title":"launchd for osx","user":{"login":"mikedodge04","id":4033125,"avatar_url":"https://avatars.githubusercontent.com/u/4033125?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedodge04","html_url":"https://github.com/mikedodge04","followers_url":"https://api.github.com/users/mikedodge04/followers","following_url":"https://api.github.com/users/mikedodge04/following{/other_user}","gists_url":"https://api.github.com/users/mikedodge04/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedodge04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedodge04/subscriptions","organizations_url":"https://api.github.com/users/mikedodge04/orgs","repos_url":"https://api.github.com/users/mikedodge04/repos","events_url":"https://api.github.com/users/mikedodge04/events{/privacy}","received_events_url":"https://api.github.com/users/mikedodge04/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chef/chef/labels/Waiting%20for%20Contributor%20Response","name":"Waiting for Contributor Response","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/chef/chef/milestones/13","html_url":"https://github.com/chef/chef/milestones/Accepted%20Minor","labels_url":"https://api.github.com/repos/chef/chef/milestones/13/labels","id":975715,"number":13,"title":"Accepted Minor","description":"Bucket to pull issues from for next minor","creator":{"login":"lamont-granquist","id":454857,"avatar_url":"https://avatars.githubusercontent.com/u/454857?v=3","gravatar_id":"","url":"https://api.github.com/users/lamont-granquist","html_url":"https://github.com/lamont-granquist","followers_url":"https://api.github.com/users/lamont-granquist/followers","following_url":"https://api.github.com/users/lamont-granquist/following{/other_user}","gists_url":"https://api.github.com/users/lamont-granquist/gists{/gist_id}","starred_url":"https://api.github.com/users/lamont-granquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamont-granquist/subscriptions","organizations_url":"https://api.github.com/users/lamont-granquist/orgs","repos_url":"https://api.github.com/users/lamont-granquist/repos","events_url":"https://api.github.com/users/lamont-granquist/events{/privacy}","received_events_url":"https://api.github.com/users/lamont-granquist/received_events","type":"User","site_admin":false},"open_issues":265,"closed_issues":71,"state":"open","created_at":"2015-02-11T18:42:48Z","updated_at":"2016-02-09T18:44:54Z","due_on":null,"closed_at":null},"comments":44,"created_at":"2015-10-27T21:44:10Z","updated_at":"2016-02-09T18:49:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/4111","html_url":"https://github.com/chef/chef/pull/4111","diff_url":"https://github.com/chef/chef/pull/4111.diff","patch_url":"https://github.com/chef/chef/pull/4111.patch"},"body":"@jaymzh will merge under his CCLA once it's passed review by @chef / @client-core\r\n\r\n### launchd\r\nThis resource installs/removes Launch Daemons and Agents\r\n\r\n#### Actions\r\n- :create\r\n- :create_if_missing\r\n- :delete\r\n\r\n#### Parameter attributes:\r\n- `label` - This required key uniquely identifies the job to launchd.\r\n- `path` - This is used as an override. By default the provider will generate a\r\npath for you based on service_type. Default: /Library/LaunchDaemons/#{label}\r\n- `hash` - key, value pairs to create launchd plist.\r\n- `source` - Source path to launchd plist.\r\n- `cookbook` - Cookbook which source file exists. Default: current cookbook\r\n- `service_type` - is the type of launchd plist you would like to create.\r\nOptions are [system, user], System with create LaunchDaemon, and User will\r\ncreate a LaunchAgent. Default: system\r\n\r\n##### Apple Params\r\nThese parameters are Apples keys/values that you can add to a launch daemon or\r\nagent. For more details see:\r\n\r\nhttps://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html#//apple_ref/doc/man/5/launchd.plist\r\n\r\n- `program` - This key maps to the first argument of execvp(3). If this key is\r\nmissing, then the first element of the array of strings provided to the\r\nProgramArguments will be used instead. This key is required in the absence of\r\nthe ProgramArguments key.\r\n- `program_arguments` - This key maps to the second argument of execvp. This key\r\nis required in the absence of the Program key. Please note: many people are\r\nconfused by this key. Please read execvp very carefully!\r\n- `abandon_process_group` - When a job dies, launchd kills any remaining\r\nprocesses with the same process group ID as the job. Set-ting Setting ting\r\nthis key to true disables that behavior.\r\n- `debug` - This optional key specifies that launchd should adjust its log mask\r\ntemporarily to LOG_DEBUG while dealing with this job.\r\n- `disabled` - This optional key is used as a hint to launchctl(1) that it\r\nshould not submit this job to launchd when loading a job or jobs.\r\n- `enable_globbing` - This flag causes launchd to use the glob(3) mechanism to\r\nupdate the program arguments before invocation.\r\n- `enable_transactions` - This flag instructs launchd that the job promises to\r\nuse vproc_transaction_begin(3) and vproc_transaction_end(3) to track\r\noutstanding transactions that need to be reconciled before the process can\r\nsafely terminate. If no outstanding transactions are in progress, then launchd\r\nis free to send the SIGKILL signal.\r\n- `environment_variables` - This optional key is used to specify additional\r\nenvironmental variables to be set before running the job.\r\n- `exit_timeout` - The amount of time launchd waits before sending a SIGKILL\r\nsignal. The default value is 20 seconds. The value zero is interpreted as\r\ninfinity.\r\n- `group` - This optional key specifies the group to run the job as. This key is\r\nonly applicable when launchd is running as root. If UserName is set and\r\nGroupName is not, the the group will be set to the default group of the user.\r\n- `hard_resource_limits` - Resource limits to be imposed on the job. These\r\nadjust variables set with setrlimit(2).\r\n- `inetd_compatibility` - The presence of this key specifies that the daemon\r\nexpects to be run as if it were launched from inetd.\r\n- `init_groups` - This optional key specifies whether initgroups(3) should be\r\ncalled before running the job. The default is true in 10.5 and false in 10.4.\r\n- `keep_alive` - This optional key is used to control whether your job is to be\r\nkept continuously running or to let demand and conditions control the\r\ninvocation.\r\n- `launch_only_once` - This optional key specifies whether the job can only be\r\nrun once and only once. In other words, if the job cannot be safely respawned\r\nwithout a full machine reboot, then set this key to be true.\r\n- `limit_load_from_hosts` - This configuration file only applies to hosts NOT\r\nlisted with this key\r\n- `limit_load_to_hosts` - This configuration file only applies to the hosts\r\nlisted with this key\r\n- `limit_load_to_session_type` - This configuration file only applies to\r\nsessions of the type specified\r\n- `low_priority_io` - This optional key specifies whether the kernel should\r\nconsider this daemon to be low priority when doing file system I/O.\r\n- `mach_services` - This optional key is used to specify Mach services to be\r\nregistered with the Mach bootstrap sub-system.\r\n- `nice` - This optional key specifies what nice(3) value should be applied to\r\nthe daemon.\r\n- `on_demand` - This key was used in Mac OS X 10.4 to control whether a job was\r\nkept alive or not.\r\n- `process_type` - This optional key describes, at a high level, the intended\r\npurpose of the job. The system will apply resource limits based on what kind\r\nof job it is. [Background, Standard, Adaptive, Interactive]\r\n- `queue_directories` - Much like the WatchPaths option, this key will watch the\r\npaths for modifications. The difference being that the job will only be\r\nstarted if the path is a directory and the directory is not empty.\r\n- `root_directory` - This optional key is used to specify a directory to\r\nchroot(2) to before running the job.\r\n- `run_at_load` - This optional key is used to control whether your job is\r\nlaunched once at the time the job is loaded. The default is false.\r\n- `sockets` - This optional key is used to specify launch on demand sockets that\r\ncan be used to let launchd know when to run the job.\r\n- `soft_resource_limits` - Resource limits to be imposed on the job. These\r\nadjust variables set with setrlimit(2).\r\n- `standard_error_path` - This optional key specifies what file should be used\r\nfor data being sent to stderr when using stdio(3).\r\n- `standard_in_path` - This optional key specifies what file should be used for\r\ndata being supplied to stdin when using stdio(3).\r\n- `standard_out_path` - This optional key specifies what file should be used for\r\ndata being sent to stdout when using stdio(3).\r\n- `start_calendar_interval` - This optional key causes the job to be started\r\nevery calendar interval as specified.\r\n- `start_interval` - This optional key causes the job to be started every N\r\nseconds.\r\n- `start_on_mount` - This optional key causes the job to be started every time a\r\nfilesystem is mounted.\r\n- `throttle_interval` - This key lets one override the default throttling policy\r\nimposed on jobs by launchd. The value is in seconds, and by default, jobs will\r\nnot be spawned more than once every 10 seconds.\r\n- `time_out` - The recommended idle time out (in seconds) to pass to the job. If\r\nno value is specified, a default time out will be supplied by launchd for use\r\nby the job at check in time.\r\n- `umask` - This optional key specifies what value should be passed to umask(2)\r\nbefore running the job.\r\n- `username` - This optional key specifies the user to run the job as. This key\r\nis only applicable when launchd is running as root.\r\n- `wait_for_debugger` - This optional key specifies that launchd should instruct\r\nthe kernel to have the job wait for a debugger to attach before any code in\r\nthe job is executed.\r\n- `watch_paths` - This optional key causes the job to be started if any one of\r\nthe listed paths are modified.\r\n- `working_directory` - This optional key is used to specify a directory to\r\nchdir(2) to before running the job.\r\n\r\n#### Examples\r\nCreate a LaunchDaemon from cookbook file\r\n```\r\nlaunchd 'com.chef.every15' do\r\n  source 'com.chef.every15.plist'\r\nend\r\n```\r\n\r\nCreate a LaunchDaemon using keys\r\n```\r\nlaunchd 'call.mom.weekly' do\r\n  program '/Library/scripts/call_mom.sh'\r\n  start_calendar_interval 'Weekday' => 7, 'Hourly' => 10\r\n  time_out 300\r\nend\r\n```\r\n\r\nRemove LaunchDaemon\r\n```\r\nlaunchd 'com.chef.every15' do\r\n  action :delete\r\nend\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/182001279","html_url":"https://github.com/chef/chef/pull/4111#issuecomment-182001279","issue_url":"https://api.github.com/repos/chef/chef/issues/4111","id":182001279,"user":{"login":"thommay","id":8500,"avatar_url":"https://avatars.githubusercontent.com/u/8500?v=3","gravatar_id":"","url":"https://api.github.com/users/thommay","html_url":"https://github.com/thommay","followers_url":"https://api.github.com/users/thommay/followers","following_url":"https://api.github.com/users/thommay/following{/other_user}","gists_url":"https://api.github.com/users/thommay/gists{/gist_id}","starred_url":"https://api.github.com/users/thommay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thommay/subscriptions","organizations_url":"https://api.github.com/users/thommay/orgs","repos_url":"https://api.github.com/users/thommay/repos","events_url":"https://api.github.com/users/thommay/events{/privacy}","received_events_url":"https://api.github.com/users/thommay/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T18:49:38Z","updated_at":"2016-02-09T18:49:38Z","body":"@mikedodge04 @jaymzh please fix the specs for this and then we're ready to merge."}}