Skip to main content

Run the agent in user context

During the installation of Snow Inventory Agent for macOS, LaunchDaemons for scheduled scan, application metering and cloud application metering are installed. As LaunchDaemons, they are run by the system (root). To be able to run them in user context and not as root, they have to be changed to LaunchAgents. As LaunchAgents, they are run by the logged in user account.

To change from running as root to running as the logged in user:

  1. Make the primary user owner of the directory /opt/snow and all files in that directory:

    sudo chown -R username:wheel /opt/snow
  2. Deactivate the Inventory, Cloud metering and Metering LaunchDaemons:

    cd /Library/LaunchDaemons
    sudo launchctl unload com.snowsoftware.Inventory.plist
    sudo launchctl unload com.snowsoftware.Cloudmetering.plist
    sudo launchctl unload com.snowsoftware.Metering.plist
  3. Make sure the plist files have 644 permissions:

    -rw-r--r--  1 root  wheel  554 Aug 28 16:26 com.snowsoftware.Metering.plist
  4. Move the plist files from /Library/LaunchDaemons/ to /Library/LaunchAgents/:

    sudo mv com.snowsoftware.Inventory.plist 
    /Library/LaunchAgents/com.snowsoftware.Inventory.plist

    sudo mv com.snowsoftware.Metering.plist
    /Library/LaunchAgents/com.snowsoftware.Metering.plist

    sudo mv com.snowsoftware.Cloudmetering.plist
    /Library/LaunchAgents/com.snowsoftware.Cloudmetering.plist
  5. Change directory to LaunchAgents and load the plist files as the logged in user:

    cd /Library/LaunchAgents
    launchctl load com.snowsoftware.Inventory.plist
    launchctl load com.snowsoftware.Cloudmetering.plist
    launchctl load com.snowsoftware.Metering.plist
  6. Check if the LaunchAgents were loaded properly. It should look like below:

    $ launchctl list | grep com.snowsoftware
    xxx 0 com.snowsoftware.Metering
    0 com.snowsoftware.Cloudmetering
    0 com.snowsoftware.Inventory

Known limitations

  • Environment variables for root will not be collected.

  • Information about a potential domain/directory service will not be collected.

  • Installation of Chrome extension will not work. See workaround below.

Chrome extension workaround

  1. Disable the Chrome extension installation in the agent configuration file, snowagent.config:

    <Setting key="saas.chrome.enabled" value="false" />
  2. Distribute the extension via Google Chrome Adminstration console.