PaperCut Install Using Launchd

alstos
New Contributor

I am relatively new to JAMF and not knowledgeable of scripting.

I am trying to install Papercut in our mac computer labs. According to Papercut, I need the PCClient.app bundled with the Launchd plist and a launchctl kickstart (???) deployed with management software. Printer Drivers are already installed on all macs which are stationary (no laptops) and don’t leave the network.

The PCClient.app is already installed on the mac lab machines. I also have a JAMF Policy set up which seems to correctly install the Launchd com.papercut.client.plist to /Library/LaunchAgents. I just need a Launchctl kickstart which I assume means scripting???

When I tried setting this up manually at a specific computer, per https://papercut.com/kb/Main/MacClientStartupWith Launchd it all worked fine (I was using the default KeepAlive setting which is what I want), so I think all I have left to do to make it all work through Jamf is to set up Process 4 of this document which changes the ownership and permissions of the com.papercut.client.plist. Not knowing scripting, it seems to me that I could add an Execute command to Files and Processes in the Launchd plist Policy I have and insert the three commands there separated by semi colons. Does this sound feasible?

The three commands are:

cd /Library/LaunchAgents/
sudo chown root:wheel com.papercut.client.plist
sudo chmod 644 com.papercut.client.plist

4 REPLIES 4

mm2270
Legendary Contributor II

I wouldn't use cd in a script like that. It's better to simply put the full path to the plist file in the command if you need to. Such as:

chown root:wheel /Library/LaunchAgents/com.papercut.client.plist
chmod 644 /Library/LaunchAgents/com.papercut.client.plist

Note that I took out the sudo's because it's not necessary when talking about a Jamf policy.

Step 6 in the instructions you posted has the launchctl command needed to load the agent once it's in place and has the right permissions and ownership. However, be aware that putting that exact command in a script run by a Jamf policy won't work, because policies run as root, and a LaunchAgent has to be loaded as the user. You can get around this by running launchctl as the user. Or, you can simply allow the LaunchAgent to kick in naturally after a logout/login or a reboot and login.

alstos
New Contributor

Thanks mm27270! So for the launchctl part, I could just set the policy restart options to restart after the policy runs, and when someone logs in it should kick in I guess.

mconners
Valued Contributor

Hello @alstos and welcome to our community. For us, we configure the config.properties file located in /Applications/Contents/Resources folder. The configuration is the server IP address, port and server name. Once configured, we ensure the com.papercut.client.plist is located in the /Library/LaunchAgents folder with the permissions described by @mm2270 mentioned above. I do this all using Composer to capture the files during an snapshot install. Then I package these files up and install using Jamf. The files are installed into the right location with the correct permissions. I don't have the script a thing. The launch agent runs for all users and this has worked for us for a number of years now.
71b9e7dbfc574202b998db6d22434af1

alstos
New Contributor

Thank you both!