macOS launchd Ignores Plist Edits at Runtime — Here Is the Safe Fix
On macOS, launchd reads a job's plist file only when the job is first bootstrapped, freezing environment variables in memory and ignoring any subsequent file edits. This means changing a timeout value in a plist has no effect on an already-loaded job, creating a silent mismatch between the file on disk and what launchd is actually running. The divergence can be confirmed via the launchctl print command, which will still report the old value despite the updated file. The correct remedy is to unload the job with launchctl bootout and reload it with launchctl bootstrap, but doing so mid-run force-kills the process and discards its work. A 31-line shell script that checks whether a job is idle before re-syncing its configuration offers a safer, automated alternative for production automation environments.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in