From d3551589c911a40239d5be2b7ddc414f89dd548f Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 27 Nov 2003 12:58:32 +0000 Subject: at last a good reboot/halt from kde --- move/make_live | 1 - move/move.pm | 7 ++++++- move/tree/Reboot.desktop | 13 ------------- move/tree/X_move | 2 +- move/tree/halt_reboot | 9 ++------- move/tree/startkde_move | 2 -- 6 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 move/tree/Reboot.desktop (limited to 'move') diff --git a/move/make_live b/move/make_live index acf6c955b..1a9642b21 100755 --- a/move/make_live +++ b/move/make_live @@ -90,7 +90,6 @@ print "Making live in $::prefix directory.\n"; installPackages(); run_program::rooted($::prefix, 'ldconfig'); touch("$::prefix/etc/menu/enable_simplified"); - cp_af('tree/Reboot.desktop', "$::prefix/usr/share/applnk-mdk-simplified"); $ENV{LC_ALL} = 'en_US'; #- update-menus doesn't work when there is no locale (aka locale "C") run_program::rooted($::prefix, 'update-menus', '-n'); run_program::rooted($::prefix, 'fc-cache'); #- generate cache in all directories mentioned in config file diff --git a/move/move.pm b/move/move.pm index abdf35575..e2377fd7b 100644 --- a/move/move.pm +++ b/move/move.pm @@ -153,6 +153,8 @@ sub init { install2::handleI18NClp(); } + touch '/var/run/rebootctl'; + drakx_stuff: $o->{steps}{$_} = { reachable => 1, text => $_ } foreach qw(initGraphical autoSelectLanguage handleI18NClp verifyKey configMove startMove); @@ -289,7 +291,7 @@ sub key_installfiles { } sub reboot { - touch '/tmp/reboot'; #- tell X_move to not respawn + output('/var/run/rebootctl', "reboot"); #- tell X_move to not respawn system("killall X"); #- kill it ourselves to be sure that it won't lock console when killed by our init exit 0; } @@ -536,6 +538,8 @@ sub install2::startMove { output("/var/run/console/$username", 1); run_program::run('pam_console_apply'); + run_program::run('chown', "$username.root", '/var/run/rebootctl'); + touch '/var/run/utmp'; run_program::run('runlevel_set', '5'); member($_, qw(xfs dm devfsd syslog)) or run_program::run($_, 'start') foreach glob('/etc/rc.d/rc5.d/*'); @@ -560,6 +564,7 @@ sub install2::startMove { $ENV{LOGNAME} = $ENV{USER} = $username; $ENV{HOME} = $home; $ENV{SHELL} = $shell; + $ENV{XDM_MANAGED} = '/var/run/rebootctl,maysd,mayfn,sched'; #- for reboot/halt availability of "logout" by kde exec 'startkde_move'; } else { exec 'xwait' or c::_exit(0); diff --git a/move/tree/Reboot.desktop b/move/tree/Reboot.desktop deleted file mode 100644 index 71449b6c2..000000000 --- a/move/tree/Reboot.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Name=Reboot -Exec=halt_reboot -Terminal=false -Icon=exit.png -Type=Application -Separator=true -ForceLast=true - -Name[fr]=Redémarrer -Name[it]=Riavvia -Name[es]=Reiniciar -Name[de]=Neustart diff --git a/move/tree/X_move b/move/tree/X_move index a5969ed9a..0656468ad 100755 --- a/move/tree/X_move +++ b/move/tree/X_move @@ -1,7 +1,7 @@ #!/bin/bash ok=0 -while [ "$ok" == 0 -a ! -f /tmp/reboot ]; do +while [ "$ok" == 0 -a ! -s /var/run/rebootctl ]; do X $@ ok=$? done diff --git a/move/tree/halt_reboot b/move/tree/halt_reboot index d31032fe6..b4b1d4ede 100755 --- a/move/tree/halt_reboot +++ b/move/tree/halt_reboot @@ -1,10 +1,5 @@ #!/bin/sh +echo "reboot" > /var/run/rebootctl 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 +sudo killall X diff --git a/move/tree/startkde_move b/move/tree/startkde_move index 402803b5e..e8bec3da7 100755 --- a/move/tree/startkde_move +++ b/move/tree/startkde_move @@ -2,8 +2,6 @@ #- 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 -- cgit v1.2.1