Skip to main content
Question

Programmatically "reset printing system" via command line

  • October 18, 2013
  • 30 replies
  • 435 views

Show first post

30 replies

johntgeck
Forum|alt.badge.img+7
  • Contributor
  • February 8, 2023

This has stopped working on Ventura sadly... it's getting Killed:9 either when Jamf runs it, or even me with sudo.  Trying to find some solutions, but running into this still.


Some logs for good measure, we have a policy that resets printing system and then adds lab printers in a computer lab.

Executing Policy Mabpool Drivers and Queue Reset
Running script Reset Printing System...
Script exit code: 137
Script result: /Library/Application Support/JAMF/tmp/Reset Printing System: line 2: 72478 Killed: 9 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/printtool --reset -f
Error running script: return code was 137.

 

Any thoughts or suggestions are helpful!


Imagine the pain I feel at discovering this right *after* I finished upgrading a lab to Ventura. 😭
lmk if you find any solutions to this.


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • February 13, 2023

This has stopped working on Ventura sadly... it's getting Killed:9 either when Jamf runs it, or even me with sudo.  Trying to find some solutions, but running into this still.


Some logs for good measure, we have a policy that resets printing system and then adds lab printers in a computer lab.

Executing Policy Mabpool Drivers and Queue Reset
Running script Reset Printing System...
Script exit code: 137
Script result: /Library/Application Support/JAMF/tmp/Reset Printing System: line 2: 72478 Killed: 9 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/printtool --reset -f
Error running script: return code was 137.

 

Any thoughts or suggestions are helpful!


Are you running just the printtool command when you run it manually, or are you trying to run an entire script? I was able to run the printtool command on my macOS 13.2 device both with sudo and without and did not receive any errors.

I would look at your overall script. The error states it is failing at line 2. What is line 2 in the script?


erik_crouch
Forum|alt.badge.img+1
  • New Contributor
  • February 13, 2023

Are you running just the printtool command when you run it manually, or are you trying to run an entire script? I was able to run the printtool command on my macOS 13.2 device both with sudo and without and did not receive any errors.

I would look at your overall script. The error states it is failing at line 2. What is line 2 in the script?


Hey, thanks for getting back!  Line 2 is as follows...

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/printtool --reset -f

EDIT:
I was running it as part of a script, and it was getting killed 9 in the script and when I ran it manually as sudo... but I just tried it on a system that has 13.2, and it did not kill it.  I'll try it again via the script and see what happens... maybe Apple fixed something?


erik_crouch
Forum|alt.badge.img+1
  • New Contributor
  • February 13, 2023

Are you running just the printtool command when you run it manually, or are you trying to run an entire script? I was able to run the printtool command on my macOS 13.2 device both with sudo and without and did not receive any errors.

I would look at your overall script. The error states it is failing at line 2. What is line 2 in the script?


Sure enough, it is working now... it must have been broken in 13.1 as that is when I was noticing the printer lists weren't getting cleared as intended. 

@johntgecklooks like this is working now, my script is very simple and it as follows.  It looks like it requires 13.2 to work correctly, as it was failing before.

#/bin/sh
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/printtool --reset -f


johntgeck
Forum|alt.badge.img+7
  • Contributor
  • March 23, 2023

Sure enough, it is working now... it must have been broken in 13.1 as that is when I was noticing the printer lists weren't getting cleared as intended. 

@johntgecklooks like this is working now, my script is very simple and it as follows.  It looks like it requires 13.2 to work correctly, as it was failing before.

#/bin/sh
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/printtool --reset -f


Sorry I am just getting back to this now, but I appreciate you tagging me! I'll give this a shot. :)