Thursday, May 5, 2011

vps ssh not starting after update in openvz

if you face this condition, you are almost doomed for reinstall, but wait!

updated:
edit /vz/private/[vbox#]/etc/init/ssh.conf,
comment off oom never:
#oom never

reboot the vps, it shall work :)
or else, try alternative below:
---------------------

there is a way to solve this..
1st, create a file in /etc/init.d/sshstart

fill it up with:
sh /etc/init.d/ssh start

then run
/sbin/vzctl runscript [vps container #] /vz/private/[vpscontainer#]/etc/init.d/sshstart

if you get any error, this might give you lead on how to solve it.

but as for my condition, i found the problem in the /var/log/daemon.log to refer to:
init: ssh main process (21717) terminated with status 255
Failed to spawn ssh pre-start process: unable to set oom adjustment: Operation not permitted

Someone suggested that the issue is because the ssh is not launched after network, therefore to fix it, you will need to edit /etc/ssh/sshd_config and enable the line ListenAddress 0.0.0.0

But in my case, it didnt work. so ive done a work around to start it via vzctl.
If you dont know your vps container #, its in
ls /vz/private/

References:

1 comment:

sumeet said...

Thanx a lot !! thanks a lot !! You saved a life !