summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-01-01 11:54:22 +0000
committerAlex Harpin <development@landsofshadow.co.uk>2015-01-01 11:54:22 +0000
commita541f066264c8a238f0c1aadf3e64e651c22e219 (patch)
tree688967221533b0da589611d7a73dbcc859112d99 /scripts
parent1509bdbdf68d69fc9a9a071e70cbdd5a264bcd6f (diff)
downloadvyatta-op-a541f066264c8a238f0c1aadf3e64e651c22e219.tar.gz
vyatta-op-a541f066264c8a238f0c1aadf3e64e651c22e219.zip
vyatta-op: on shutdown/reboot the client ssh session doesn't disconnect
When either the reboot or poweroff commands are issued from the CLI, any ssh clients currently connected to the system aren't disconnected correctly, having to rely on a timeout to terminate them. The sendsigs process doesn't fully close sshd before the network is taken down, with the result that the client don't receive the disconnect signal. Bug #298 http://bugzilla.vyos.net/show_bug.cgi?id=298
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-reboot.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/vyatta-reboot.pl b/scripts/vyatta-reboot.pl
index 3dc212c..bec4ebd 100755
--- a/scripts/vyatta-reboot.pl
+++ b/scripts/vyatta-reboot.pl
@@ -67,7 +67,9 @@ sub do_reboot {
my $login = shift;
syslog("warning", "Reboot now requested by $login");
- exec("sudo /sbin/reboot");
+ if (!system("sudo /sbin/reboot")) {
+ exec("sudo /usr/bin/killall sshd");
+ }
}
sub cancel_reboot {