Starting the Client on Mac OS with Launchd
Last modified on 11 August 2020 10:41 PM
For Macintosh computers running OS X 10.7 and later, and most especially Mac OS X 10.10 Yosemite and later, launchd is the most practical approach to launching the PCClient.app. As Apple has begun to focus heavily on securing root access to systems Login Hooks have been deprecated in favor of LaunchDaemons and LaunchAgents and have safer, less wide-reaching system access.
We highly recommend using the Launch Agent method described below. Apple also recommends using this method as opposed to using a login hook, as described on their Apple Developer website. For an in-depth guide to launchd and how it operates you may wish to peruse http://launchd.info which is a human-readable guide for writing, configuring, and maintaining launchd guides.
Setting up Launchd:
Please note: Before rolling out your PCClient.app launchd plist it is highly recommended that you test it on either a Mac OS VM, a dedicated testing workstation, or the Mac of a user who is a willing guinea pig.
Also, the supplied launchd plist is best suited for Macs that do not leave your network, i.e. iMacs, Mac Pros, and Mac Minis that are primarily stationary. If you are looking for a solution better suited to portable Macs like MacBooks, MacBook Airs, and MacBook Pros please see the advanced configuration section below.
Advanced Configuration Options:
Launchd plist contents:
The above-linked .zip file contains com.papercut.client.plist, which is the following XML information:
<xml version=“1.0″ encoding=“UTF-8″> <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=“1.0″> <dict> <key>Label</key> <string>com.papercut.client.agent</string> <key>ProgramArguments</key> <array> <string>/Applications/PCClient.app/Contents/MacOS/JavaAppLauncher</string> </array> <key>KeepAlive</key> <true/> </dict> </plist>
One disadvantage of the Login Hook approach is that only a single Login Hook may be defined. This may not be a great limitation as you can run multiple commands with a single Login Hook script. However, in some deployment situations other application installs may interfere with the Login Hook and an alternative startup mechanism may be sought.