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.

And does it just “runs” with whatever name you set it to?

yup. Clarification, the one that I “named” is the activateSetings in system.activationScripts.activateSettings.text, not the command. So it could have been something like system.activationScripts.kickStartScript.text, or system.activationScripts.bootRunner.text, etc.

Yep, thanks. That is what I understood. So the name doesn’t matter at all? You can use nay name and it will be ran?

That’s my understanding, similar to some of the other identifiers in Nix. IE, when creating a file, etc.

1 Like