Octory – The mac admins Swiss Army knife, episode II.

Using different configurations.

In episode II I’m going to talk about some ways to run Octory using different methods of delivering and specifying the configuration plist.

This is the result of my extensive testing and imagining crazy uses for Octory and relates to the version out now, 2.0.1. Behaviours may change in later versions.

Default behaviour.

A couple of things to note about default behaviour.

Default plist.

Running Octory with no config it will try and find Octory.plist in

/Library/Managed Preferences/ and /Library/Application Support/Octory in that order. 

Observation: I deployed an Octory.plist to the /Library/Managed Preferences/ folder using Jamf by configuring a custom profile. Although the profile was there and was readable Octory didn’t find it.

 Last config.

Octory records the last config file used to successfully launch it. It records this in ~/Library/Preferences/Octory.plist. 

This can be handy for repeatedly testing different versions of a configuration but can catch you out, well it did me! This auto save behaviour will be changing in later version to be a command line switch option.

Update – 16 May 2020. From V 2.0.2 this behaviour has changed. The previous config is not saved unless the switch –save is used in addition to –config

 

Using different configs.

So you want to get a bit more out of Octory than just a build screen,I know I do because it’s a very versatile user info screen. I have built processes that have multiple screens presented as the process runs, even swapping between MenuBar and Simple windows.

So don’t mess about having loads of configurations and renaming them as you use them, simply use the -c or –config argument mentioned here .

I use this line extensively in various tools;

    sudo -u ${LOGGEDINUSER} open -a "/Library/Application Support/Octory/Octory.app/Contents/MacOS/Octory" --args --config ${OCTORY_PLIST}

Clearly this one uses variables and is from a script running as root, hence the sudo -u ${LOGGEDINUSER}

Observation:I have found this to be the most reliable launch method.

File locations

The important thing to note is that this option also uses /Library/Managed Preferences/ and /Library/Application Support/Octory as its search paths so any plists must exist in those paths, or in a subfolder which must be referenced relative to them.

So if the configuration plist is in /Library/Application Support/Octory/Configs then the option should read: –config Configs/myconfig.plist.

Using MDM

I mainly deploy configs using MDM configuration profiles, Jamf in my case. Regardless of which one they all end up in /Library/Managed Preferences/ so will be found if only the file name is specified: –config myconfig.plist.

Advantages of this method are it’s easy to deploy to managed devices, and to update if required.

Flipping configs!

I’m not losing my temper with them here but referring to changing configs. The important thing is you can only have one Octory session running so if you want to change to a different session make sure you kill the first one, either using one of the built in window closing methods or a simple killall Octory works a treat.

You can then load up the next config you require.

I use this method in a user admin elevation tool like this:

  1. User logs in – launchagent starts up Octory as a MenuBar app.
  2. User runs it which starts the process as root (see episode I. ).
  3. Kills the MenuBar app then does its work.
  4. Loads an Octory user confirmation Simple screen.
  5. Kills the info screen then reloads the MenuBar app ready for next use.

All the configurations for this are deployed by MDM.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s