2014年 08月 29日
サーバーコンソールのプロンプトが戻らない場合の対処方法 - xm consolle
しかし、仮想マシンが Linux のようなテキスト端末が使える場合は良いのですが、仮想マシンが GUI しか備えていない場合、 RunLevel 3 やテキスト端末から
xm console windows-vm
とやってしまうと、Windows には GUI がないため悲しい事になります。コンソールのプロンプトが戻ってきません。
その様な場合、xm console を Kill する方法です。
リモートSSH接続できる場合はターミナルから kill できます。
sles11:~ # xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 10060 4 r----- 152014.7
blog 768 2 0.0
centos7 512 1 0.0
dns3 1 512 4 -b---- 1497.6
eilian 6 512 1 -b---- 103368.8
mrtg 2 128 1 -b---- 1199.7
oes11x2 3 1200 2 -b---- 33790.1
oes11x4 1500 4 0.0
opensuse12 768 1 0.0
sles11-on-iSCSI 512 4 7.7
wprs 768 2 0.0
wsus 8 2200 4 -b---- 11104.3
<-- xm console してしまった仮想マシン。
zabbix 5 1200 1 -b---- 31230.9
zenws 2400 2 227.6
sles11:~ # ps ax | grep tty*
3539 ? Sl 0:38 /usr/lib/xen/bin/qemu-system-i386 -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null
5282 tty2 Ss+ 0:00 /sbin/mingetty tty2
5283 tty3 Ss+ 0:00 /sbin/mingetty tty3
5284 tty4 Ss+ 0:00 /sbin/mingetty tty4
5285 tty5 Ss+ 0:00 /sbin/mingetty tty5
5286 tty6 Ss+ 0:00 /sbin/mingetty tty6
23953 ? Ss 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
23954 ? S 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
23955 ? S 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
23956 ? S 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
23957 ? S 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
23958 ? S 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
24507 tty1 Ss 0:00 -bash
24694 tty1 Sl+ 0:00 /usr/lib64/xen/bin/xenconsole 8 --num 0
<--- これだ。 xenconsole 8 というのが xm list と一致する。
24810 pts/0 R+ 0:00 grep tty*
sles11:~ # kill 24694 <-- Kill する
tty1はサーバーコンソールです。ここで動作しているプロセスを grep して見つけ出し、kill します。
無事、コンソールにプロンプトが戻ってきました。
他に、リモート端末ではなく、直接コンソールから操作sして、プロンプトが戻らない場合も同様に「却って来ないプロセス」を停止する方法として応用できそうです。startx なんかでよく、プロンプトが戻らない場合もあるので、この方法で停止できそうです。
-Keyword-
SUSE SLES Linux xm console コンソール プロンプトが戻らない コンソールプロセスを切断
その他の情報は
islandcenter.jp