Finding init process ID or killing container

From Notes_Wiki
Revision as of 11:14, 25 February 2015 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>Troubleshooting_openVZ_issues|Troubleshooting openVZ issues</yambe:breadcrumb> =Finding init process ID or killing container= If "vzctl stop <CTID>" o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>Troubleshooting_openVZ_issues|Troubleshooting openVZ issues</yambe:breadcrumb>

Finding init process ID or killing container

If "vzctl stop <CTID>" or "vzctl restart <CTID>" hangs then we can kill the container using following steps:

  1. Find container init process ID using:
    lsof 2>&1 | grep /vz/root/<CTID>/ | grep -v UID | less
    The process which has /dev/null open inside the container is init. Typically first lowest (PID) should also be of init
  2. Use ' kill -9 <init-pid>' to kill the container.