{"id":20272410,"url":"https://github.com/cybertk/launchd-oneshot","last_synced_at":"2025-07-03T07:35:06.563Z","repository":{"id":139072561,"uuid":"47195672","full_name":"cybertk/launchd-oneshot","owner":"cybertk","description":"Run a oneshot job at next boot/login time","archived":false,"fork":false,"pushed_at":"2016-01-21T11:53:28.000Z","size":26,"stargazers_count":22,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T04:42:04.267Z","etag":null,"topics":["launchd-agent"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cybertk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-01T14:45:34.000Z","updated_at":"2024-10-12T18:44:44.000Z","dependencies_parsed_at":"2023-03-22T04:05:25.530Z","dependency_job_id":null,"html_url":"https://github.com/cybertk/launchd-oneshot","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertk%2Flaunchd-oneshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertk%2Flaunchd-oneshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertk%2Flaunchd-oneshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybertk%2Flaunchd-oneshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cybertk","download_url":"https://codeload.github.com/cybertk/launchd-oneshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["launchd-agent"],"created_at":"2024-11-14T12:43:13.836Z","updated_at":"2025-04-11T04:42:08.625Z","avatar_url":"https://github.com/cybertk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# launchd-oneshot\n\n\u003e Run a oneshot job at next boot/login time on OSX\n\n[![CI Status](http://img.shields.io/travis/cybertk/launchd-oneshot/master.svg?style=flat)](https://travis-ci.org/cybertk/launchd-oneshot)\n\n## Installation\n\n**launchd-oneshot** can be installed via Homebrew\n\n```bash\nbrew install cybertk/formulae/launchd-oneshot\n```\n\n## Getting started\n\nTo add a oneshot job `script.sh` to run at next boot time\n\n```bash\nsudo launchd-oneshot script.sh\n```\n\nTo add a oneshot job `script.sh` to run at next user login time\n\n```bash\nsudo launchd-oneshot script.sh --on-login\n```\n\nTo add a oneshot job `script.sh` to run at next user login time with root, and **launchd-oneshot** will pass current login user as `$1` to `script.sh`\n\n```bash\nsudo launchd-oneshot script.sh --on-login-as-root\n```\n\n\n## Troubleshooting\n\nlogs is written to `/tmp/launchd-oneshot.log`, you can view it with\n\n```bash\ntail -f /tmp/launchd-oneshot.log\n```\n\n## How does launchd-oneshot work?\n\n**launchd-oneshot** installs a **launchd agent** under `/Library/LaunchDaemons` for each job. When agent is running, it will start **launchd-oneshot** in **RUN** mode, which will execute the origin job and remove the **launchd agent** when job is completed.\n\nFor `--on-login` job, in order to run the job as root, **launchd-oneshot** will install a trigger **launchd agent** under `/Library/LaunchAgents` in addition. When user login, the trigger agent will start running. And it will trigger the **launchd agent** under `/Library/LaunchDaemons` to run through launchd's `KeepAlive:OtherJobEnabled` mechanism.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybertk%2Flaunchd-oneshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcybertk%2Flaunchd-oneshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybertk%2Flaunchd-oneshot/lists"}