Successfully kill and restart iTunes in Wine (Ubuntu & Apple TV 2 / ATV2)

I run iTunes under Wine on my Ubuntu server to share media to an Apple TV 2 using Home sharing. Since upgrading to iTunes 10.4.1 under Wine I've had regular issues with my Apple TV 2 no longer seeing the Ubuntu based iTunes Home share after a period of time. The easy way I've found to fix this is to kill iTunes in Wine and restart it is as follow a helpful script to achieve this follows...


Create a new shell script, with the following code:

#!/bin/bash 
killall iTunes.exe
killall wineserver
killall winedevice.exe
killall iPodService.exe
killall AppleMobileDevi
killall distnoted.exe
killall explorer.exe
killall rpcss.exe
killall mDNSReponder.exe
killall services.exe
wine ~/.wine/dosdevices/c:/Program\ Files/iTunes/iTunes.exe

Chmod the script to make it executable

sudo chmod 555 scriptname

When the ATV2 loses the Wine iTunes home share kick off the script... I'm in the process of moving iTunes to a virtualised Windows XP install still on the Ubuntu server to reduce the wine/iTunes headache read more here. 

3 comments:

Note: only a member of this blog may post a comment.