Skip to main content
added 462 characters in body
Source Link
Fabian
  • 65
  • 1
  • 8

I use my iMac almost every day as a 27" external display with my MacBook Pro.

  • While connected, the iMac won't go to sleep, which is exactly what it is expected.
  • But, after disconnecting, the iMac should go to sleep. Somehow, it is prevented (in order to always be ready to connect, again?). The problem: If you do not set it to "sleep" manually, it will stay on forever! This is really annoying to find your iMac running all night...

I once saw a terminal/shell command that would kill the Target Display Mode (TDM) service, but I can't find it anymore.pmset -g | grep sleep tells you this:

 hibernatefile        /var/vm/sleepimage
 networkoversleep     0
 disksleep            10
 sleep                10 (sleep prevented by sharingd, dpd, useractivityd)
 displaysleep         10 (display sleep prevented by dpd)

Obviously, sleep and display sleep are prevented by dpd (Display Port Daemon), see also an unanswered question in Apple Communities: DisplayPort daemon (dpd) blocks sleep even when not in use.

I use my iMac almost every day as a 27" external display with my MacBook Pro.

  • While connected, the iMac won't go to sleep, which is exactly what it is expected.
  • But, after disconnecting, the iMac should go to sleep. Somehow, it is prevented (in order to always be ready to connect, again?). The problem: If you do not set it to "sleep" manually, it will stay on forever! This is really annoying to find your iMac running all night...

I once saw a terminal/shell command that would kill the Target Display Mode (TDM) service, but I can't find it anymore.

I use my iMac almost every day as a 27" external display with my MacBook Pro.

  • While connected, the iMac won't go to sleep, which is exactly what it is expected.
  • But, after disconnecting, the iMac should go to sleep. Somehow, it is prevented (in order to always be ready to connect, again?). The problem: If you do not set it to "sleep" manually, it will stay on forever! This is really annoying to find your iMac running all night...

pmset -g | grep sleep tells you this:

 hibernatefile        /var/vm/sleepimage
 networkoversleep     0
 disksleep            10
 sleep                10 (sleep prevented by sharingd, dpd, useractivityd)
 displaysleep         10 (display sleep prevented by dpd)

Obviously, sleep and display sleep are prevented by dpd (Display Port Daemon), see also an unanswered question in Apple Communities: DisplayPort daemon (dpd) blocks sleep even when not in use.

Source Link
Fabian
  • 65
  • 1
  • 8

How to overcome "Target Display Mode" from preventing sleep after disconnecting?

I use my iMac almost every day as a 27" external display with my MacBook Pro.

  • While connected, the iMac won't go to sleep, which is exactly what it is expected.
  • But, after disconnecting, the iMac should go to sleep. Somehow, it is prevented (in order to always be ready to connect, again?). The problem: If you do not set it to "sleep" manually, it will stay on forever! This is really annoying to find your iMac running all night...

I once saw a terminal/shell command that would kill the Target Display Mode (TDM) service, but I can't find it anymore.