Open erikng opened 4 years ago
I've been pondering this as well in my testing...
Currently, I've been unloading IA's LaunchDaemon from within the user script if it fails. That method is less than ideal and requires some hacking.
An idea (haven't tested this):
iaslog('Failed to run user script!')
in https://github.com/macadmins/installapplications/commit/5218c9683c0ec72e784106611a93eafb5b0ed20f we could drop another artifact (eg. touch a file)? while os.path.isfile(userscripttouchpath):
process breaks, we could check if that artifact is present and stop the run there?That's a pretty good idea.
if root scripts fail multiple times, the run will stop, however if a user script fails, the run will keep going.
This is could be problematic for environments that need the user section to complete successfully. With https://github.com/macadmins/installapplications/commit/5218c9683c0ec72e784106611a93eafb5b0ed20f I fixed the infinite looping when not exiting 0, but introduced this issue.
This will be a difficult one to solve since the user side runs in a different process and we cannot capture the state of the run itself.