launchd: wait for /nix/store before starting agent (#8609)
On Darwin, launchd may attempt to start agents before the Nix store is mounted and available. This leads to failures when the agent's executable or arguments reside in the Nix store. This change wraps the agent's command in a shell script that uses /bin/wait4path to ensure /nix/store is ready before executing the original program. It also ensures that ProgramArguments are correctly escaped and concatenated.
This commit is contained in:
parent
ef5da06269
commit
eec72f1278
30 changed files with 123 additions and 90 deletions
|
|
@ -17,9 +17,9 @@
|
|||
<string>Background</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/some/command</string>
|
||||
<string>--with-arguments</string>
|
||||
<string>foo</string>
|
||||
<string>/bin/sh</string>
|
||||
<string>-c</string>
|
||||
<string>/bin/wait4path /nix/store && exec /some/command --with-arguments foo</string>
|
||||
</array>
|
||||
<key>UnrecognizedByHomeManager</key>
|
||||
<string>should make it to the resulting plist</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue