summaryrefslogtreecommitdiffstats
path: root/move
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-26 16:46:26 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-26 16:46:26 +0000
commit023504a1a6d43414f366562485d14dcbdffbedc8 (patch)
treeb2b766daa41f94683e2d81c2b9cad576c7f804ae /move
parent0088de274228b3a7d55b64481a6dbdb54b8e4279 (diff)
downloaddrakx-backup-do-not-use-023504a1a6d43414f366562485d14dcbdffbedc8.tar
drakx-backup-do-not-use-023504a1a6d43414f366562485d14dcbdffbedc8.tar.gz
drakx-backup-do-not-use-023504a1a6d43414f366562485d14dcbdffbedc8.tar.bz2
drakx-backup-do-not-use-023504a1a6d43414f366562485d14dcbdffbedc8.tar.xz
drakx-backup-do-not-use-023504a1a6d43414f366562485d14dcbdffbedc8.zip
allow to reboot the machine
Diffstat (limited to 'move')
-rw-r--r--move/Makefile2
-rwxr-xr-xmove/tree/X_move2
-rwxr-xr-xmove/tree/halt_reboot10
-rwxr-xr-xmove/tree/startkde_move8
4 files changed, 20 insertions, 2 deletions
diff --git a/move/Makefile b/move/Makefile
index c4068b8ff..8f9b82583 100644
--- a/move/Makefile
+++ b/move/Makefile
@@ -7,7 +7,7 @@ ISO = /BIG/mdkmove.iso
DATA_FILES = devices symlinks directories-to-create etcfiles all-etcfiles keyfiles \
BOOT-800-MOVE.jpg BOOT-1024-MOVE.jpg BOOT-1280-MOVE.jpg BOOT-1600-MOVE.jpg
-PROGRAM_FILES = etc-monitorer.pl tree/startkde_move tree/wait4x
+PROGRAM_FILES = etc-monitorer.pl tree/startkde_move tree/wait4x tree/halt_reboot
LANG_FILES = $(shell perl -ne 'print $$1 if /ALLOWED_LANGS = qw\((.*)\)/' move.pm)
STAGE1 = ../mdk-stage1
diff --git a/move/tree/X_move b/move/tree/X_move
index df085fcd8..a5969ed9a 100755
--- a/move/tree/X_move
+++ b/move/tree/X_move
@@ -1,7 +1,7 @@
#!/bin/bash
ok=0
-while [ "$ok" == 0 ]; do
+while [ "$ok" == 0 -a ! -f /tmp/reboot ]; do
X $@
ok=$?
done
diff --git a/move/tree/halt_reboot b/move/tree/halt_reboot
new file mode 100755
index 000000000..d31032fe6
--- /dev/null
+++ b/move/tree/halt_reboot
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+sudo killall -USR1 startkde_move
+
+if [ $UID == 0 ]; then
+ user=`getent passwd 501 | perl -ne 'print $1 if /([^:]+):/'`
+ su $user -c 'dcop kdesktop default logout'
+else
+ dcop kdesktop default logout
+fi \ No newline at end of file
diff --git a/move/tree/startkde_move b/move/tree/startkde_move
index 9169add40..402803b5e 100755
--- a/move/tree/startkde_move
+++ b/move/tree/startkde_move
@@ -1,5 +1,13 @@
#!/bin/sh
+#- exit cleanly on SIGUSR1, so that our init can see a clean shutdown and automatically reboot
+reboot () {
+ touch /tmp/reboot
+ sudo killall X
+ exit 0
+}
+trap 'reboot' SIGUSR1
+
while true; do
wait4x || exit 1
xwait -permanent &