diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2011-02-11 01:08:59 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2011-02-11 01:08:59 -0500 |
commit | bf94d2cda272851c5741aad132cbd2616b053dac (patch) | |
tree | 4f472ac150eaccbb72bf0260a3cfcc195eed5e2f | |
parent | b03519760cfac14636629c234a3ed2d2c93be2f5 (diff) | |
download | kvm-manager-bf94d2cda272851c5741aad132cbd2616b053dac.tar.gz kvm-manager-bf94d2cda272851c5741aad132cbd2616b053dac.tar.bz2 |
auto-launch (and background, ugh) a screen session connected to the console
-rwxr-xr-x | kvm-manager | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kvm-manager b/kvm-manager index 8e193f4..e381f91 100755 --- a/kvm-manager +++ b/kvm-manager @@ -60,6 +60,7 @@ up() { fi MONITORNAME="$OWNERHOME/vms/$VMNAME/monitor.socket" + CONSOLENAME="$OWNERHOME/vms/$VMNAME/console.socket" kvmsend() { socat STDIO "UNIX:$MONITORNAME" <<EOF @@ -80,11 +81,14 @@ EOF -rtc base=utc \ -usb \ -device virtio-balloon-pci,id=balloon0,bus=pci.0 \ - -chardev "socket,id=serial0,path=$OWNERHOME/vms/$VMNAME/console.socket,server,nowait" -device isa-serial,chardev=serial0 \ + -chardev "socket,id=serial0,path=$CONSOLENAME,server,nowait" -device isa-serial,chardev=serial0 \ -smp "${SMP:-1},maxcpus=${MAXCPUS:-8}" \ -device "virtio-net-pci,vlan=0,id=net0,mac=$MAC,bus=pci.0" \ -net "tap,ifname=$TAP,script=no,downscript=no,vlan=0,name=hostnet0" & + chpst -u "$OWNER:$OWNERGROUP" \ + /usr/bin/screen -d -m -L -c /etc/screenrc.kvm-manager -S "$VMNAME" -t "$VMNAME" socat STDIO,raw,echo=0 "UNIX:${CONSOLENAME},retry=30" + set +e # handle regular signals trap 'kvmsend system_reset; wait' HUP |