OpenVZ Forum


Home » General » Support » OpenVZ VPS Ubuntu 16.04 Container Fails to Reboot/Restart at SSH Commandline (reboot/restart failure of openvz vps running ubuntu 16.04 template)
OpenVZ VPS Ubuntu 16.04 Container Fails to Reboot/Restart at SSH Commandline [message #53253] Mon, 30 July 2018 08:49 Go to next message
thed010 is currently offline  thed010
Messages: 4
Registered: July 2018
Junior Member
From: *41.2.123.sta.dodo.net.au
hello all.

i am running an ubuntu 16.04 (64-bit) template on an openvz vps (kernel 2.6.32-042stab127.2).

whenever i attempt to reboot/restart the vps after logging in using ssh and issuing (via a Terminal window):

'reboot' or 'shutdown -r now'

the reboot/restart fails.

there is no indication in the Terminal window that a reboot/restart is in effect.

the cursor in the Terminal window moves to the following line and appears to 'hang'.

after waiting a few seconds and then hitting the keyboard 'Enter' key, the following message is displayed in the Terminal

"packet_write_wait: Connection to 1.2.3.4 port 22: Broken pipe" (the IP number shown '1.2.3.4' has been modified by me for reasons of privacy)

any suggestions or help on what might be causing the commandline-mediated reboot/restart failure?

(all other commandline calls to the vps appear to function as expected, and commandline-mediated reboot/restart succeeds when using other OS templates (e.g. CentOS 6) on the same vps).

cheers.

thed

.


[Updated on: Mon, 30 July 2018 08:55]

Report message to a moderator

Re: OpenVZ VPS Ubuntu 16.04 Container Fails to Reboot/Restart at SSH Commandline [message #53257 is a reply to message #53253] Mon, 30 July 2018 15:39 Go to previous messageGo to next message
paulocoghi is currently offline  paulocoghi
Messages: 13
Registered: July 2018
Junior Member
From: *virtua.com.br
When you execute 'reboot', 'shutdown -r now', 'init 6' or any other command related to restart your container, your terminal session connected into your container may freeze, and there is no problem with this.

This occurs because your terminal session may not identify that the container is not responding anymore, naturally, since it is restarting, and the message "packet_write_wait: Connection to 1.2.3.4 port 22: Broken pipe" is the natural consequence because it reached a timeout.

In short, your container is rebooting normally and this isn't a issue. Sometimes, when you executes a reboot command, the session may or may not end immediately. And it's ok Smile
Re: OpenVZ VPS Ubuntu 16.04 Container Fails to Reboot/Restart at SSH Commandline [message #53261 is a reply to message #53257] Mon, 30 July 2018 17:28 Go to previous messageGo to next message
thed010 is currently offline  thed010
Messages: 4
Registered: July 2018
Junior Member
From: *41.2.123.sta.dodo.net.au
many thanks for your considered response paulocoghi.

you "hit the nail on the head".

upon further examination, i ascertained that the openvz container (vps) did indeed reboot/restart, even though the Terminal appeared to 'hang.'

in an effort to cleanly terminate an ssh connection in ubuntu 16.04 (64-bit) the following can be attempted:

open a Terminal and connect to the vps as root or non-root user.

issue:

(sudo) apt-get install libpam-systemd dbus

then restart the vps [ (sudo) reboot or (sudo) shutdown -r now ]

re-establish an ssh connection to the vps by logging in as root or non-root user and then issue:

(sudo) reboot

if all goes well, the ssh connection should terminate cleanly now with a response such as the following:

Connection to 1.2.3.4 closed by remote host.
Connection to 1.2.3.4 closed.

thed

.


Re: OpenVZ VPS Ubuntu 16.04 Container Fails to Reboot/Restart at SSH Commandline [message #53262 is a reply to message #53261] Mon, 30 July 2018 22:13 Go to previous messageGo to next message
paulocoghi is currently offline  paulocoghi
Messages: 13
Registered: July 2018
Junior Member
From: *virtua.com.br
Thanks for sharing your solution!

Just a note for other users. To guarantee the module will be used, you need to check in "/etc/ssh/sshd_config" that UsePAM is enabled with "UsePAM yes".

To apply the changes made to configuration, restart ssh service with:

In Ubuntu:
sudo service ssh restart


In Debian:
sudo service sshd restart

[Updated on: Mon, 30 July 2018 22:17]

Report message to a moderator

Re: OpenVZ VPS Ubuntu 16.04 Container Fails to Reboot/Restart at SSH Commandline [message #53264 is a reply to message #53262] Tue, 31 July 2018 01:52 Go to previous message
thed010 is currently offline  thed010
Messages: 4
Registered: July 2018
Junior Member
From: *41.2.123.sta.dodo.net.au
another 'thumbs-up' to paulocoghi.

as noted by paulocoghi, the 'UsePAM' parameter in the file '/etc/ssh/sshd_config' (this parameter was located at the end of the file content on my system) should be set to 'yes', so that the line in the file should read:

UsePAM yes

although this was the default setting for this parameter on my system [ubuntu 16.04 (64-bit)], it may be important to check the file and confirm the setting.

thanks again.


Previous Topic: OpenVZ7: restart vz service does not auto-start CTs
Next Topic: OVZ7 Hyper-converged Storage Solution
Goto Forum:
  


Current Time: Mon Aug 20 04:57:56 GMT 2018