I have tried this at Kubuntu 10.10 and Xubuntu 10.04.
My goal is to kill an XBMC and restart it after resume. The process should go that way:
1. Suspend command
2. XBMC killed
3. PC sleeping
4 Resume command
5 PC resuming
6 XBMC launched


1. Suspend command
2. PC sleeping
3. Resume command
4. PC resuming
5 XBMC killed
6 XBMC launched

I had some troubles with killing XBMC, so I tried the script with Firefox and Krusader too. The script will kill Krusader and Firefox, but will not relaunch them.

Here is a script I tried with Firefox

sudo touch /etc/pm/sleep.d/99_restartFirefox
sudo chmod a+x /etc/pm/sleep.d/99_restartFirefox
sudo nano /etc/pm/sleep.d/99_restartFirefox
I create the following content:

# restart Firefox
# position /etc/pm/sleep.d/99_restartFirefox

#case "$1" in
killall firefox-bin
exit $?
It seems I am missing something in the launch app command, any help