It appears that OpenVZ and CentOS can have some issues regarding udev. After installing the Development tools yum package I found myself unable to do anything in the container. It generated an error on ssh
, vzctl enter
etc.
Unable to open pty: No such file or directory
There are numerous posts on fixing the problem. most remove the udev package but that can be problematic as some packages (ImageMagick for example) seem to require udev. For those packages it seems best to leave udev present but disabled.
Be sure that the core elements you use from those packages do not need udev.
The fix then becomes a two step process. The first steps are done from the node, adjust your vz container ID from 101 as needed. Re-create the missing devices.
You should be able to log in via ssh or vzctl enter BUT the problem may re-appear on an update (yum update). The next steps should help with that. Enter the container and edit the file /etc/rc.sysinit
. Search for the line /sbin/start_udev
and replace it with the following. This disables udev without removing the package and auto-repairs the devices if by some chance they go missing again.
As an alternative to changing /etc/rc.sysinit
you can remove the udev
package, but be prepared for dependencies to load it again. If you do this you may also wish to add udev
to the YUM ignore list.
This will return the package to remove, for example: udev-095-14.9.el5
References
- A good resource for OpenVZ issues: http://platonic.techfiz.info/2008/10/08/unable-to-open-pty-no-such-file-or-directory/
- http://praji.wordpress.com/unable-to-open-pty-no-such-file-or-directory/
- http://www.eukhost.com/forums/f29/vps-unable-open-pty-no-such-file-directory-2666/
- OpenVZ forum thread http://forum.openvz.org/index.php?t=msg&goto=30337
- Technical discussion http://forum.openvz.org/index.php?t=msg&goto=26055
Leave a comment