From 7e8f0340e3ea157f8b77fadd1b2b01c570d72e67 Mon Sep 17 00:00:00 2001 From: Gregor Fuis Date: Mon, 27 Feb 2012 21:32:59 +0100 Subject: [PATCH] xbmc & xbmc-pvr: redesign of poweroff and reboot. Change lock file location --- packages/mediacenter/xbmc-pvr/init.d/93_xbmc | 13 +++++++------ .../mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit | 0 packages/mediacenter/xbmc/init.d/93_xbmc | 13 +++++++------ packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit | 0 .../sysutils/ConsoleKit/scripts/ck-system-restart | 5 +++-- packages/sysutils/ConsoleKit/scripts/ck-system-stop | 5 +++-- 6 files changed, 20 insertions(+), 16 deletions(-) mode change 100644 => 100755 packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit mode change 100644 => 100755 packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit diff --git a/packages/mediacenter/xbmc-pvr/init.d/93_xbmc b/packages/mediacenter/xbmc-pvr/init.d/93_xbmc index 176dc6344e..4477d39a2f 100644 --- a/packages/mediacenter/xbmc-pvr/init.d/93_xbmc +++ b/packages/mediacenter/xbmc-pvr/init.d/93_xbmc @@ -72,14 +72,15 @@ fi )& # prevent restrating XBMC at reboot or shutdown - XBMC_LOCKED="/storage/xbmc_locked" - [ -f $XBMC_LOCKED ] && rm -f $XBMC_LOCKED & + LOCKDIR="/var/lock/" + LOCKFILE="xbmc.disabled" + [ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" & # starting XBMC usleep $XBMC_STARTDELAY while true; do - while [ -f $XBMC_LOCKED ]; do + while [ -f "$LOCKDIR/$LOCKFILE" ]; do usleep 250000 done @@ -89,19 +90,19 @@ fi case "$RET" in 0) if [ ! $(pidof console-kit-daemon) ]; then - touch $XBMC_LOCKED + touch "$LOCKDIR/$LOCKFILE" poweroff -f fi ;; 64) if [ ! $(pidof console-kit-daemon) ]; then - touch $XBMC_LOCKED + touch "$LOCKDIR/$LOCKFILE" poweroff -f fi ;; 66) if [ ! $(pidof console-kit-daemon) ]; then - touch $XBMC_LOCKED + touch "$LOCKDIR/$LOCKFILE" reboot fi ;; diff --git a/packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit b/packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit old mode 100644 new mode 100755 diff --git a/packages/mediacenter/xbmc/init.d/93_xbmc b/packages/mediacenter/xbmc/init.d/93_xbmc index 3a198e27fe..97d6723376 100644 --- a/packages/mediacenter/xbmc/init.d/93_xbmc +++ b/packages/mediacenter/xbmc/init.d/93_xbmc @@ -72,14 +72,15 @@ fi )& # prevent restrating XBMC at reboot or shutdown - XBMC_LOCKED="/storage/xbmc_locked" - [ -f $XBMC_LOCKED ] && rm -f $XBMC_LOCKED & + LOCKDIR="/var/lock/" + LOCKFILE="xbmc.disabled" + [ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" & # starting XBMC usleep $XBMC_STARTDELAY while true; do - while [ -f $XBMC_LOCKED ]; do + while [ -f "$LOCKDIR/$LOCKFILE" ]; do usleep 250000 done @@ -89,19 +90,19 @@ fi case "$RET" in 0) if [ ! $(pidof console-kit-daemon) ]; then - touch $XBMC_LOCKED + touch "$LOCKDIR/$LOCKFILE" poweroff -f fi ;; 64) if [ ! $(pidof console-kit-daemon) ]; then - touch $XBMC_LOCKED + touch "$LOCKDIR/$LOCKFILE" poweroff -f fi ;; 66) if [ ! $(pidof console-kit-daemon) ]; then - touch $XBMC_LOCKED + touch "$LOCKDIR/$LOCKFILE" reboot fi ;; diff --git a/packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit b/packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit old mode 100644 new mode 100755 diff --git a/packages/sysutils/ConsoleKit/scripts/ck-system-restart b/packages/sysutils/ConsoleKit/scripts/ck-system-restart index 4c77c37e7c..35aa9e976b 100755 --- a/packages/sysutils/ConsoleKit/scripts/ck-system-restart +++ b/packages/sysutils/ConsoleKit/scripts/ck-system-restart @@ -20,7 +20,8 @@ # http://www.gnu.org/copyleft/gpl.html ################################################################################ -XBMC_LOCKED="/storage/xbmc_locked" -touch $XBMC_LOCKED +LOCKDIR="/var/lock/" +LOCKFILE="xbmc.disabled" +touch "$LOCKDIR/$LOCKFILE" wait_on_xbmc_exit reboot diff --git a/packages/sysutils/ConsoleKit/scripts/ck-system-stop b/packages/sysutils/ConsoleKit/scripts/ck-system-stop index cc93d11f2f..edaa2b308c 100755 --- a/packages/sysutils/ConsoleKit/scripts/ck-system-stop +++ b/packages/sysutils/ConsoleKit/scripts/ck-system-stop @@ -20,7 +20,8 @@ # http://www.gnu.org/copyleft/gpl.html ################################################################################ -XBMC_LOCKED="/storage/xbmc_locked" -touch $XBMC_LOCKED +LOCKDIR="/var/lock/" +LOCKFILE="xbmc.disabled" +touch "$LOCKDIR/$LOCKFILE" wait_on_xbmc_exit poweroff