system.activationScripts alternative

hi there,

After the recent update, it looks like system.activationScripts has been removed.

I was using:

system.activationScripts.postUserActivation.text = ''
    # Following line should allow us to avoid a logout/login cycle
    /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
  '';

I am now getting:

error:
       Failed assertions:
       - The `system.activationScripts.postUserActivation` option has
       been removed, as all activation now takes place as `root`. Please
       restructure your custom activation scripts appropriately,
       potentially using `sudo` if you need to run commands as a user.

This is being used on my Mac. Have any others looked at an alternative method?

Cheers.

I don’t think it’s telling you not to use activation scripts. I think it’s just telling you to use a different one and use sudo to run as a particular user.

I realized that after. Two things had confused me. Usually, when something is deprecated, it directly lists the replacement. I had a typo in my options search while looking for a replacement, which led me to think there was no alternative.

My brain took a holiday on that one.

Going to test:

  system.userActivationScripts.text = ''
    Following line should allow us to avoid a logout/login cycle
    /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
  '';

This is what I ended up with:


system.activationScripts.activateSettings.text = ''
 # Following line should allow us to avoid a logout/login cycle
    /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
'';

where activateSettings is a name I assigned.