Skip to main content
Solved

killall Dock fails in Self Service

  • February 11, 2026
  • 1 reply
  • 59 views

smurf
Forum|alt.badge.img+1

For test purposes, I have a very simple shell script. 

#!/bin/sh

killall Dock

exit 0

A policy runs the script, and it’s available in Self Service. When I run it from Self Service, it works as expected (I can see the Dock restart itself). Hooray!

However... (1)Self Service reports “Item Failed”, and (2)when I go to the Policy and check its logs, there’s no indication the Policy ever ran (status remains Pending).

Is there a way to reset the Dock that Self Service won’t regard as a failure, and fail to log the Policy execution?

 

Best answer by h1431532403240

The issue is about how Self Service tracks policy execution status.

When a user clicks "Run" in Self Service, the Self Service app launches the jamf daemon to execute the policy and keeps an internal reference to track the execution result. Self Service is a macOS GUI app that relies on the Dock and WindowServer to maintain its process state.

When the script runs killall Dock, macOS terminates the Dock process and launchd restarts it. This causes a brief disruption to all GUI apps' window management — including Self Service itself. During this disruption, Self Service loses its internal tracking state for the in-progress policy execution. Since it never receives a proper completion callback:

  1. Self Service reports "Item Failed" — it defaults to failure because the tracking was interrupted
  2. Policy log stays Pending — the execution result was never submitted back to the Jamf Pro server

The script did execute successfully (the Dock did restart), but the reporting mechanism was broken.

Fix: Background the killall command so the script exits cleanly first, giving the jamf daemon time to report success before the Dock is killed:

#!/bin/sh
sleep 1 && killall Dock &
exit 0

1 reply

h1431532403240
Forum|alt.badge.img+6
  • Contributor
  • Answer
  • February 12, 2026

The issue is about how Self Service tracks policy execution status.

When a user clicks "Run" in Self Service, the Self Service app launches the jamf daemon to execute the policy and keeps an internal reference to track the execution result. Self Service is a macOS GUI app that relies on the Dock and WindowServer to maintain its process state.

When the script runs killall Dock, macOS terminates the Dock process and launchd restarts it. This causes a brief disruption to all GUI apps' window management — including Self Service itself. During this disruption, Self Service loses its internal tracking state for the in-progress policy execution. Since it never receives a proper completion callback:

  1. Self Service reports "Item Failed" — it defaults to failure because the tracking was interrupted
  2. Policy log stays Pending — the execution result was never submitted back to the Jamf Pro server

The script did execute successfully (the Dock did restart), but the reporting mechanism was broken.

Fix: Background the killall command so the script exits cleanly first, giving the jamf daemon time to report success before the Dock is killed:

#!/bin/sh
sleep 1 && killall Dock &
exit 0