Commit 2a1379b7 authored by Dietmar Maurer's avatar Dietmar Maurer

updates for vzctl 4.0

parent b8238244
......@@ -864,7 +864,11 @@ __PACKAGE__->register_method ({
my $remcmd = $remip ?
['/usr/bin/ssh', '-c', 'blowfish-cbc', '-t', $remip] : [];
my $shcmd = [ '/usr/sbin/vzctl', 'enter', $vmid ];
mkdir "/var/run/dtach";
my $shcmd = [ '/usr/bin/dtach', '-A',
"/var/run/dtach/vzctlconsole$vmid",
'-r', 'winch', '-z',
'/usr/sbin/vzctl', 'console', $vmid ];
my $realcmd = sub {
my $upid = shift;
......
......@@ -6,7 +6,7 @@ use POSIX ":sys_wait_h";
use Fcntl ':flock';
use Getopt::Long;
use Time::HiRes qw (gettimeofday);
use PVE::Tools;
use PVE::Tools qw(dir_glob_foreach file_read_firstline);
use PVE::ProcFSTools;
use Filesys::Df;
use PVE::INotify;
......@@ -199,6 +199,45 @@ sub update_qemu_status {
}
}
sub find_vzctl_console_pids {
my $res = {};
dir_glob_foreach('/proc', '\d+', sub {
my ($pid) = @_;
my $cmdline = file_read_firstline("/proc/$pid/cmdline");
return if !$cmdline;
my @args = split(/\0/, $cmdline);
# serach for vzctl console <vmid>
return if scalar(@args) != 3;
return if $args[1] ne 'console';
return if $args[2] !~ m/^\d+$/;
return if $args[0] !~ m|^(/usr/sbin/)?vzctl$|;
my $vmid = $args[2];
push @{$res->{$vmid}}, $pid;
});
return $res;
}
sub remove_stale_openvz_consoles {
my $vmstatus = PVE::OpenVZ::vmstatus();
my $pidhash = find_vzctl_console_pids();
foreach my $vmid (keys %$pidhash) {
next if defined($vmstatus->{$vmid});
syslog('info', "remove stale vzctl console for CT $vmid");
foreach my $pid (@{$pidhash->{$vmid}}) {
kill(9, $pid);
}
}
}
sub update_openvz_status {
my $ctime = time();
......@@ -281,6 +320,12 @@ sub update_status {
};
$err = $@;
syslog('err', "storage status update error: $err") if $err;
eval {
remove_stale_openvz_consoles();
};
$err = $@;
syslog('err', "openvz console cleanup error: $err") if $err;
}
my $next_update = 0;
......
pve-manager (2.2-20) unstable; urgency=low
* openvz: use real console instead of 'vzctl enter'
* openvz: remove init-logger pagers
* dpenend on dtach (used by openvz console)
* pvestatd: remove stale 'vzctl console' processes
-- Proxmox Support Team <support@proxmox.com> Tue, 02 Oct 2012 06:49:12 +0200
pve-manager (2.2-19) unstable; urgency=low
* fix bug 178: use new API call to get next free VMID
......
......@@ -3,7 +3,7 @@ Version: @VERSION@-@PACKAGERELEASE@
Section: admin
Priority: optional
Architecture: all
Depends: perl5, libtimedate-perl, apache2-mpm-prefork, libauthen-pam-perl, libintl-perl, rsync, libapache2-request-perl, libjson-perl, liblockfile-simple-perl, vncterm, qemu-server (>= 1.1-1), libwww-perl, wget, libnet-dns-perl, vlan, ifenslave-2.6 (>= 1.1.0-10), liblinux-inotify2-perl, debconf (>= 0.5) | debconf-2.0, netcat-traditional, pve-cluster, libpve-common-perl, libpve-storage-perl, libterm-readline-gnu-perl, libpve-access-control, libio-socket-ssl-perl, libfilesys-df-perl, libfile-readbackwards-perl, libfile-sync-perl, redhat-cluster-pve, resource-agents-pve, fence-agents-pve, cstream, mail-transport-agent, libxml-parser-perl, perl-suid, lzop
Depends: perl5, libtimedate-perl, apache2-mpm-prefork, libauthen-pam-perl, libintl-perl, rsync, libapache2-request-perl, libjson-perl, liblockfile-simple-perl, vncterm, qemu-server (>= 1.1-1), libwww-perl, wget, libnet-dns-perl, vlan, ifenslave-2.6 (>= 1.1.0-10), liblinux-inotify2-perl, debconf (>= 0.5) | debconf-2.0, netcat-traditional, pve-cluster, libpve-common-perl, libpve-storage-perl, libterm-readline-gnu-perl, libpve-access-control, libio-socket-ssl-perl, libfilesys-df-perl, libfile-readbackwards-perl, libfile-sync-perl, redhat-cluster-pve, resource-agents-pve, fence-agents-pve, cstream, mail-transport-agent, libxml-parser-perl, perl-suid, lzop, dtach
Conflicts: netcat-openbsd, vzdump
Replaces: vzdump
Provides: vzdump
......
......@@ -2,7 +2,7 @@ RELEASE=2.2
VERSION=2.2
PACKAGE=pve-manager
PACKAGERELEASE=19
PACKAGERELEASE=20
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5
......
......@@ -360,7 +360,7 @@ Ext.define('PVE.OpenVZConsole', {
{
text: gettext('Start'),
handler: function() {
vm_command("start", {}, 1);
vm_command("start");
}
},
{
......@@ -387,14 +387,7 @@ Ext.define('PVE.OpenVZConsole', {
});
}
},
// Note: no migrate here, because we can't display migrate log
// and openvz migrate does not work if console is open
{
text: gettext('Console'),
handler: function() {
PVE.Utils.openConoleWindow('openvz', me.vmid, me.nodename, me.vmname);
}
},
// Note: no migrate here, because we can't display migrate log
'->',
{
text: gettext('Refresh'),
......
......@@ -152,16 +152,6 @@ Ext.define('PVE.openvz.Config', {
]
});
if (caps.vms['VM.Console']) {
me.items.push({
title: "InitLog",
itemId: 'initlog',
xtype: 'pveLogView',
url: '/api2/extjs/nodes/' + nodename + '/openvz/' + vmid + '/initlog'
});
}
if (caps.vms['VM.Backup']) {
me.items.push({
title: gettext('Backup'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment