CentOS 7.3.1611 ssh client hangs on remote reboot
Hi,
I am trying to run "ssh root@x.x.x.x reboot" from one of my primary blade to reboot secondary blade. I am executing this command from a perl script using system function. I see ssh client getting hanged until secondary blade comes up. From Journal logs i see sshd client sessions not getting SIGTERM to exit on reboot in secondary blade. Interfaces are getting closed first and sshd service is getting stopped by systemd. Centos details i am using: uname -r => 3.10.0-862.14.4.el7.x86_64 cat /etc/redhat-release => CentOS Linux release 7.3.1611 (Core) I could see similar issue which got fixed in Redhat and Debian. But not able to get details for centos. https://bugzilla.redhat.com/show_bug.cgi?id=626477 https://bugs.debian.org/cgi-bin/bugrepo ... bug=751636 https://bugzilla.redhat.com/show_bug.cgi?id=1047614 Can some one through some light on this and help me in identifying the root cause. Any help you could provide would be much appreciated. Thanks, Karthik |
You've gotta add killall sshd somewhere but I don't use systemd that much so I'm not sure where that'd go.
On the other hand, why does that bother you so much? Do you reboot so many times everyday? You have two options of either running ssh with "timeout" prepended or simply press "shift + ~ + ."(3 keys), that'll terminate ssh. |
One really shouldn't allow root to log in directly.
Additionally, it might be better to use systemctl commands instead of systemd-sysvcompat commands. probably doesn't matter, but can't hurt to try. Assuming sudo is configured, why don't you try Code:
ssh user@x.x.x.x sudo systemctl reboot |
Hi,
Thanks for the replies. Actually this issue is coming for me only when i try to run this from a perl script but not when executed from console.Not sure what is really making the difference. Yeah there can be different options to avoid this situation, but i am more interested in knowing if this is really fixed in centos 7.3 or not. I could see some fix in Redhat as i mentioned in my previous post. Ofcourse if it is a known issue and not fixed, i can try work around as suggested, if not i can upgrade to centos OS version in which it is fixed. Thanks, Karthik |
If you're not being bound by any particular restrictions you should always upgrade redhat forks first as they're much more thoroughly tested than many other distros.
|
Isn't CentOS 8 or 9 out already?
|
@ondoho. Yes, CentOS 8 is out for almost a year now. Nevertheless, there may be sound reasons to stay with CentOS 7 for the time being. E.g. EPEL 8 is still a far cry from EPEL 7 in terms of available software.
@OP. But staying on CentOS 7.3 when 7.8 is available is not reasonable at all. |
All times are GMT -5. The time now is 01:38 AM. |