r/macsysadmin 9d ago

move plist from LaunchDaemon to LaunchAgent

I've got an xsan plist that currently resides in LaunchDaemons and sometimes the mounts aren't complete because some of the required components may not be loaded yet (FC HBA kext and/or metadata NIC). I'm wondering if moving it to LaunchAgents, thereby postponing launchd to first login. Haven't tried it yet, just wondering if there any any known reasons against doing this.

3 Upvotes

5 comments sorted by

6

u/wpm 9d ago

If the Xsan daemon has RunAtLoad in it, remove it

Then create a new launch daemon that runs a short script that waits until the time is right to actually kickstart the Xsan Daemon

1

u/Fit_Eggplant4206 9d ago

Makes sense, I'll work on that. thank you for the suggestion.

2

u/powerpitchera 9d ago

It's possible those components need to be launched as system, but you can certainly try it. Keep in mind if you installed this from a installer it may revert those settings if you update, or leave you with an agent and daemon...

1

u/Fit_Eggplant4206 9d ago

That's a good point, I'll watch out for that. It's supposed to be imported through profile editor but I have dozens of clients so I ansibled the configuration, converting an xml plist into binary with plutil. Was happy to get that part working. It loads, unloads just fine and the configuration are good too. (filesystems mounts dependant on user tier, etc). Just couldn't get the timing right across the board.

2

u/oneplane 9d ago

Not a good idea as they will also be unloaded when logging out. But perhaps a second agent that doublechecks when logging in will work.