ConsoleKit: add proper shutdown support via init scripts

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-09-08 01:57:39 +02:00
parent a839b0b65a
commit 626b77cf83
4 changed files with 37 additions and 17 deletions

View File

@ -68,13 +68,13 @@ case $RUNLEVEL in
case "$RET" in
0)
poweroff -f
RUNLEVEL="poweroff"
;;
64)
poweroff -f
RUNLEVEL="poweroff"
;;
66)
reboot
RUNLEVEL="reboot"
;;
255)
echo "Abnormal Exit. Exited with code $RET"

View File

@ -20,4 +20,20 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
reboot
. /etc/profile
progress "Reboot the syste"
RET=0
RUNLEVEL="reboot"
for script in `ls -r1 /etc/init.d/*`; do
if grep -q -e "^# runlevels:.*$MODE" $script; then
. $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done
sync
reboot

View File

@ -20,4 +20,20 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
poweroff
. /etc/profile
progress "Poweroff the system"
RET=0
RUNLEVEL="poweroff"
for script in `ls -r1 /etc/init.d/*`; do
if grep -q -e "^# runlevels:.*$MODE" $script; then
. $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done
sync
poweroff -f

View File

@ -55,15 +55,3 @@
test $S_RET -ge $RET && RET=$S_RET
fi
done
if [ -z "$RUNLEVEL" -o $RUNLEVEL="boot" ]; then
RUNLEVEL="poweroff"
fi
for script in `ls -r1 /etc/init.d/*`; do
if grep -q -e "^# runlevels:.*$MODE" $script; then
. $script
S_RET=$?
test $S_RET -ge $RET && RET=$S_RET
fi
done