Skip to content

Instantly share code, notes, and snippets.

@thimslugga
Last active April 9, 2025 02:43
Show Gist options
  • Save thimslugga/3a7c14d4542b4fffd579842cfb121556 to your computer and use it in GitHub Desktop.
Save thimslugga/3a7c14d4542b4fffd579842cfb121556 to your computer and use it in GitHub Desktop.
Running Services on macOS

Automatic Login and Namespaces

https://aahlenst.dev/blog/accessing-the-macos-gui-in-automation-contexts/#enabling-automatic-login-on-macos

https://gist.github.com/tjluoma/70c936b36d099e37ed9bf64c1df8debe

https://apple.stackexchange.com/questions/39734/how-can-i-launch-a-daemon-process-as-a-specified-user-at-boot-without-an-interac

https://www.brunerd.com/blog/2021/08/24/automating-automatic-login-for-macos/

https://gist.github.com/pudquick/b1188a35a47c314e42b6

Launchd

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html

https://gist.github.com/johndturn/09a5c055e6a56ab61212204607940fa0

https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/

https://gist.github.com/masklinn/a532dfe55bdeab3d60ab8e46ccc38a68

https://apple.stackexchange.com/questions/439094/how-do-you-load-and-start-a-launchd-job-without-using-a-plist-file

FDA Issues

If you’re calling a Bash script from launchctl, and that script writes to your disk, you need to explicitly give Bash “Full Disk Access” permissions. (In System Preferences, Security & Privacy preferences, Privacy tab.) Even if you’re calling the script as superuser, it won’t write to disk without Full Disk Access. (Giving Full Disk Access to a shell is slightly complicated: you need to open /bin in Finder, then drag the shell icon into the right part of the System Preferences window.)

https://www.kith.org/jed/2022/02/15/launchctl-scheduling-shell-scripts-on-macos-and-full-disk-access/

LNP issues

https://openradar.appspot.com/FB16541221

https://apple.stackexchange.com/questions/476182/some-programs-report-no-route-to-host-connecting-to-servers-when-run-without-s/478702#478702

https://apple.stackexchange.com/questions/478037/no-route-to-host-for-certain-applications-from-macos-host-to-macos-guest

Golang and UUID issues

golang/go#68678

hashicorp/consul#21765

LaunchAgents

https://gist.github.com/rbsgn/0d7473a2692bdf6e0ef7

LaunchDaemons

https://mariadb.com/kb/en/launchd/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment