From c2ca8e98c46975a7aa33cf0f07ae55a878c393ad Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sat, 24 Jan 2015 20:33:40 +0000 Subject: vyatta-op: final fix for the ssh client failing to disconnect on reboot Final fix to ensure that any SSH clients are sent the disconnect signal on a scheduled reboot as well as a 'reboot now'. Bug #298 http://bugzilla.vyos.net/show_bug.cgi?id=298 --- scripts/vyatta-reboot.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/vyatta-reboot.pl b/scripts/vyatta-reboot.pl index bec4ebd..860e3da 100755 --- a/scripts/vyatta-reboot.pl +++ b/scripts/vyatta-reboot.pl @@ -159,13 +159,13 @@ if ($action eq "reboot_at") { print "\nReload scheduled for $time\n\n"; if (!defined($ENV{VYATTA_PROCESS_CLIENT}) || $ENV{VYATTA_PROCESS_CLIENT} ne 'gui2_rest') { - if (! prompt("Proceed with reboot schedule? [confirm]", -y1d=>"y")) { + if (! prompt("Proceed with reboot schedule? [confirm] ", -y1d=>"y")) { print "Reboot canceled\n"; exit 1; } } - @lines = `echo sudo /sbin/reboot | at $at_time 2>&1`; + @lines = `echo "sudo /sbin/reboot && sudo /usr/bin/killall sshd" | at $at_time 2>&1`; ($err, $job, $time) = parse_at_output(@lines); if ($err) { print "Error: unable to schedule reboot\n"; -- cgit v1.2.3