macOSLAPS icon indicating copy to clipboard operation
macOSLAPS copied to clipboard

LaunchDaemon not immediately activating

Open franton opened this issue 3 years ago • 4 comments

Minor one. Doing an install from fresh doesn't automatically start the launchdaemon supplied. We have to wait for first reboot for that.

It would be possible to have a pre and a post install script that looks like this to take care of upgrades and starts:

#!/bin/zsh

#preinstall script

ld="/Library/LaunchDaemons/edu.psu.macoslaps-check.plist"

if [ -f "$ld" ];
then
	/bin/launchctl unload -w "$ld"
	/bin/rm -f "$ld"
	sleep 1
fi

exit
#!/bin/zsh

#postinstall

ld="/Library/LaunchDaemons/edu.psu.macoslaps-check.plist"
/bin/launchctl load -w "$ld"

exit

franton avatar Jan 02 '22 23:01 franton

I've provided a PR for this.

franton avatar Jan 03 '22 06:01 franton

Hello @franton!

I saw your pull request and the scripts look good. I might however modify them to use bootstrap and bootout as I believe eventually macOS will be moving to those and that load and unload are deprecated even though they still remain. I'm hoping to incorporate these as part of the package for the 2.2.0 release that is currently in BETA in the #macoslaps Slack channel. Please let me know your results if you are testing 2.2.0. Thanks!

joshua-d-miller avatar Mar 17 '22 13:03 joshua-d-miller

Hi @joshua-d-miller !

Sounds like an excellent plan to me! (I need to learn the new way and this sounds like a good way to do it.) See you in Slack!

franton avatar Mar 17 '22 13:03 franton

Hello @franton!

The prerelease has implemented these changes. Please give it a try and let me know: https://github.com/joshua-d-miller/macOSLAPS/releases/tag/3.0.0(752)

Thanks!

joshua-d-miller avatar Mar 20 '22 13:03 joshua-d-miller

This has been put in place into the latest build 3.0.2.

joshua-d-miller avatar Oct 14 '22 12:10 joshua-d-miller