(MacOS) Is there a standard location for user-specific LaunchDaemons to write a .pid file to?

13 Views Asked by At

For ...reasons outside my control... I need to setup a launchd task to run a nginx service while a specific user is logged in.

In general this has been mostly straightforward, except for the fact that /var/run is not writable from a standard user account. I also cannot just one-time create a /var/run/nginx folder with that user granted permissions to write to, as on restart the entire /var/run contents are wiped.

I couldn't seem to find any 'best practices' for other locations. And I also couldnt find a way for the launchd plist to tell it to create a writable file for the daemon (ie, something like the StandardOutPath but for a .pid file)

Help!

0

There are 0 best solutions below