Bug#560348: xen: racy temporary files for kernel and initrd

2010-08-12 Thread Ian Campbell
On Wed, 2010-08-11 at 20:56 +0200, Paul Menzel wrote:
 Am Mittwoch, den 11.08.2010, 10:40 +0100 schrieb Ian Campbell: 
  On Wed, 2010-08-11 at 00:05 +0200, Paul Menzel wrote:
   $ grep vmlinuz /tmp/squeeze.cfg 
   kernel = /tmp/vmlinuz
   $ sudo xm create /tmp/squeeze.cfg
   Using config file /tmp/squeeze.cfg.
   Error: Kernel image does not exist: /tmp/vmlinuz
   
   Do you have any idea? This is with the daily Debian Installer files from
   [2].
  
  Hrm. I assume /tmp/vmlinuz exists and is readable by the relevant user
  etc. Do the logs in /var/log/xen tell you anything?
 
[snip logs]

Thanks but unfortunately I am none the wiser :-(

 I took a look where `VmError` originates from. I think, it turns out to
 be in `/usr/lib/xen-3.2-1/lib/python/xen/xend/image.py`.
 
 if not os.path.isfile(self.kernel):
 raise VmError('Kernel image does not exist: %s' % self.kernel)
 
 But testing this manually works.
 
 $ python
  import os
  os.path.isfile(/tmp/vmlinuz)
 True

Very strange.

It is likely that the process actually running is different to the user
you used for this test so perhaps there is something about the
permissions either on the files themselves or the /tmp directory or
something?

I presume this:
$ ls -l /tmp/{vmlinuz,initrd.gz}
-rw-r--r-- 1 user user 17859729 2010-08-10 10:05 /tmp/initrd.gz
-rw-r--r-- 1 user user  2351776 2010-08-10 10:05 /tmp/vmlinuz
is still true? But what about the perms on / and /tmp?

It's unlikely but I suppose I have to ask: are you using xm on a
different machine to the one running xend? (via either the XML/RPC or
SXP/RPC mechanisms).

It might be worth doing chmod root:root on the two files.

 Then I tried it with a different Linux kernel image under `/boot/` and
 this worked. So as a last attempt I copied `vmlinuz` from `/tmp/` to
 `/boot/` and now it works as expected. Very strange! Do I need to file a
 bug for this somewhere. Could you test that under Squeeze or Sid?

I tried it under squeeze and it seems fine.

# grep kernel /etc/xen/debian-x86_32p-1 
#kernel = /boot/vmlinuz-x86_32p-xenU
#kernel = /boot/vmlinuz-2.6.32-5-xen-amd64
kernel = /tmp/vmlinuz-2.6.32-5-xen-amd64
#kernel = /scratch/lenny/i386/vmlinuz
# ls -l /tmp/vmlinuz-2.6.32-5-xen-amd64 
-rw-r--r-- 1 root root 2467552 Aug 12 09:09 /tmp/vmlinuz-2.6.32-5-xen-amd64

Ian.

-- 
Ian Campbell

 That reminds me, we'll need to buy a chainsaw for the office. In
   case of emergency, break glass




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2010-08-11 Thread Ian Campbell
On Wed, 2010-08-11 at 00:05 +0200, Paul Menzel wrote:
 Am Dienstag, den 10.08.2010, 15:10 +0100 schrieb Ian Campbell:
  On Tue, 2010-08-10 at 15:40 +0200, Paul Menzel wrote:
   Am Montag, den 21.12.2009, 09:19 + schrieb Ian Campbell:
On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
 
 The guest is the Debian Installer daily image, you surely know it much
 better than I do. :)  The host is a Lenny system with the Etch kernel:
   
   I am using Lenny with a standard Lenny kernel.
   
   $ uname -a
   Linux hostname 2.6.26-2-xen-amd64 #1 SMP Wed Mar 10 00:29:48 UTC 2010 
   x86_64 GNU/Linux
   
I think the issue is with the host's Xen utilities rather than the
Debian Installer image which makes it tricky to fix in Lenny. I believe
it works with the Xen utilities in Squeeze.
   
   Should this bug be reassigned then?
   
For Lenny you could workaround by downloading the kernel and ramdisk
locally and use the install-kernel= and install-ramdisk= options to
xm-debian.cfg, or if you have a local mirror you could just use
install-installer=.
   
   Unfortunately that work-around does not work for me.
   
   $ ls -l /tmp/{vmlinuz,initrd.gz}
   -rw-r--r-- 1 user user 17859729 2010-08-10 10:05 /tmp/initrd.gz
   -rw-r--r-- 1 user user  2351776 2010-08-10 10:05 /tmp/vmlinuz
   $ sudo xm create /tmp/xm-debian.cfg install=true 
   install-mirror=ftp://ftp.de.debian.org/debian 
   install-installer=http://people.debian.org/~joeyh/d-i/images/daily/ 
   install-suite=squeeze install-kernel=/tmp/vmlinuz 
   install-ramdisk=/tmp/initrd.gz
   Using config file /tmp/xm-debian.cfg.
   Install Mirror: ftp://ftp.de.debian.org/debian
   Install Suite: squeeze
   Installer: http://people.debian.org/~joeyh/d-i/images/daily/
   
   WARNING: Installer kernel and ramdisk are not authenticated.
   
   Fetching /tmp/vmlinuz
   Fetching /tmp/initrd.gz
   command line is debian-installer/exit/always_halt=true -- quiet 
   console=hvc0
   Error: Kernel image does not exist: /tmp/vmlinuz
   
   Do you have any ideas?
  
  It's not clear looking back over the bug that anyone ever actually tried
  the workaround, rather than hypothesising it. Unfortunately I don't have
  a suitable Lenny system to hand.
  
  You could try install-kernel=file:///
 
 That did not work either.
 
 […]
 Fetching file:///tmp/vmlinuz
 Fetching file:///tmp/initrd.gz
 command line is debian-installer/exit/always_halt=true -- quiet
 console=hvc0
 Error: Kernel image does not exist: /tmp/vmlinuz

Hmm, I suspect the workaround never worked then (it was only a theory).

  Alternatively you can always use your own configuration file (like you
  would for a non-Debian domain) [...]
 
 Thank you for your suggestion. Unfortunately I get the following error
 message.
 
 $ sudo xm create /tmp/squeeze.cfg
 Using config file /tmp/squeeze.cfg.
 Error: Boot loader didn't return any data!
 $ ls -l /usr/bin/pygrub 
 lrwxrwxrwx 1 root root 29 2010-06-15 10:51 /usr/bin/pygrub - 
 /usr/lib/xen-3.2-1/bin/pygrub
 $ dpkg -S /usr/lib/xen-3.2-1/bin/pygrub 
 xen-utils-3.2-1: /usr/lib/xen-3.2-1/bin/pygrub
 $ dpkg -l xen-utils-3.2-1
 ii  xen-utils-3.2- 3.2.1-2XEN administrative tools
 
 But reading [1] and your comment before I commented the bootloader line
 too.

That was the right thing to do for the install phase.

 $ grep vmlinuz /tmp/squeeze.cfg 
 kernel = /tmp/vmlinuz
 $ sudo xm create /tmp/squeeze.cfg
 Using config file /tmp/squeeze.cfg.
 Error: Kernel image does not exist: /tmp/vmlinuz
 
 Do you have any idea? This is with the daily Debian Installer files from
 [2].

Hrm. I assume /tmp/vmlinuz exists and is readable by the relevant user
etc. Do the logs in /var/log/xen tell you anything?

BTW, it jut occurred to me that if you install a Squeeze VM onto a Lenny
host that you will find pygrub doesn't work because the version in Lenny
didn't yet understand the grub2 cfg file format. I think d-i still
allows you to select grub1 if you use expert mode, and it looks like you
might be able to add grub-installer/grub2_instead_of_grub_legacy=false
to your command line or d-i grub-installer/grub2_instead_of_grub_legacy
boolean false to your preseed if you have one.

Ian.
-- 
Ian Campbell

He's like a function -- he returns a value, in the form of his opinion.
It's up to you to cast it into a void or not.
-- Phil Lapsley




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2010-08-11 Thread Paul Menzel
Am Mittwoch, den 11.08.2010, 10:40 +0100 schrieb Ian Campbell: 
 On Wed, 2010-08-11 at 00:05 +0200, Paul Menzel wrote:
  Am Dienstag, den 10.08.2010, 15:10 +0100 schrieb Ian Campbell:
   On Tue, 2010-08-10 at 15:40 +0200, Paul Menzel wrote:
Am Montag, den 21.12.2009, 09:19 + schrieb Ian Campbell:
 On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
  
  The guest is the Debian Installer daily image, you surely know it 
  much
  better than I do. :)  The host is a Lenny system with the Etch 
  kernel:

I am using Lenny with a standard Lenny kernel.

$ uname -a
Linux hostname 2.6.26-2-xen-amd64 #1 SMP Wed Mar 10 00:29:48 UTC 2010 
x86_64 GNU/Linux

 I think the issue is with the host's Xen utilities rather than the
 Debian Installer image which makes it tricky to fix in Lenny. I 
 believe
 it works with the Xen utilities in Squeeze.

Should this bug be reassigned then?

 For Lenny you could workaround by downloading the kernel and ramdisk
 locally and use the install-kernel= and install-ramdisk= options to
 xm-debian.cfg, or if you have a local mirror you could just use
 install-installer=.

Unfortunately that work-around does not work for me.

$ ls -l /tmp/{vmlinuz,initrd.gz}
-rw-r--r-- 1 user user 17859729 2010-08-10 10:05 /tmp/initrd.gz
-rw-r--r-- 1 user user  2351776 2010-08-10 10:05 /tmp/vmlinuz
$ sudo xm create /tmp/xm-debian.cfg install=true 
install-mirror=ftp://ftp.de.debian.org/debian 
install-installer=http://people.debian.org/~joeyh/d-i/images/daily/ 
install-suite=squeeze install-kernel=/tmp/vmlinuz 
install-ramdisk=/tmp/initrd.gz
Using config file /tmp/xm-debian.cfg.
Install Mirror: ftp://ftp.de.debian.org/debian
Install Suite: squeeze
Installer: http://people.debian.org/~joeyh/d-i/images/daily/

WARNING: Installer kernel and ramdisk are not authenticated.

Fetching /tmp/vmlinuz
Fetching /tmp/initrd.gz
command line is debian-installer/exit/always_halt=true -- 
quiet console=hvc0
Error: Kernel image does not exist: /tmp/vmlinuz

Do you have any ideas?
   
   It's not clear looking back over the bug that anyone ever actually tried
   the workaround, rather than hypothesising it. Unfortunately I don't have
   a suitable Lenny system to hand.
   
   You could try install-kernel=file:///
  
  That did not work either.
  
  […]
  Fetching file:///tmp/vmlinuz
  Fetching file:///tmp/initrd.gz
  command line is debian-installer/exit/always_halt=true -- quiet
  console=hvc0
  Error: Kernel image does not exist: /tmp/vmlinuz
 
 Hmm, I suspect the workaround never worked then (it was only a theory).
 
   Alternatively you can always use your own configuration file (like you
   would for a non-Debian domain) [...]
  
  Thank you for your suggestion. Unfortunately I get the following error
  message.
  
  $ sudo xm create /tmp/squeeze.cfg
  Using config file /tmp/squeeze.cfg.
  Error: Boot loader didn't return any data!
  $ ls -l /usr/bin/pygrub 
  lrwxrwxrwx 1 root root 29 2010-06-15 10:51 /usr/bin/pygrub - 
  /usr/lib/xen-3.2-1/bin/pygrub
  $ dpkg -S /usr/lib/xen-3.2-1/bin/pygrub 
  xen-utils-3.2-1: /usr/lib/xen-3.2-1/bin/pygrub
  $ dpkg -l xen-utils-3.2-1
  ii  xen-utils-3.2- 3.2.1-2XEN administrative tools
  
  But reading [1] and your comment before I commented the bootloader line
  too.
 
 That was the right thing to do for the install phase.
 
  $ grep vmlinuz /tmp/squeeze.cfg 
  kernel = /tmp/vmlinuz
  $ sudo xm create /tmp/squeeze.cfg
  Using config file /tmp/squeeze.cfg.
  Error: Kernel image does not exist: /tmp/vmlinuz
  
  Do you have any idea? This is with the daily Debian Installer files from
  [2].
 
 Hrm. I assume /tmp/vmlinuz exists and is readable by the relevant user
 etc. Do the logs in /var/log/xen tell you anything?

[2010-08-11 10:40:38 3386] DEBUG (XendDomainInfo:84) 
XendDomainInfo.create(['vm', ['name', 'host'], ['memory', 2048], ['vcpus', 1], 
['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'], ['image', ['linux', 
['kernel', '/tmp/vmlinuz'], ['ramdisk', '/tmp/initrd.gz'], ['args', 
'debian-installer/exit/always_halt=true -- xencons=hvc console=hvc0 ro 
root=/dev/hda']]], ['device', ['vbd', ['uname', 'phy:/dev/xkcd/oe-build-host'], 
['dev', 'xvda'], ['mode', 'w']]], ['device', ['vbd', ['uname', 
'phy:/dev/xkcd/oe-build-host-swap'], ['dev', 'xvdb'], ['mode', 'w']]], 
['device', ['vif']], ['device', ['vif', ['bridge', 'xenbr1')
[2010-08-11 10:40:38 3386] DEBUG (XendDomainInfo:1618) 
XendDomainInfo.constructDomain
[2010-08-11 10:40:38 3386] DEBUG (balloon:132) 

Bug#560348: xen: racy temporary files for kernel and initrd

2010-08-10 Thread Paul Menzel
Am Montag, den 21.12.2009, 09:19 + schrieb Ian Campbell:
 On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
  
  The guest is the Debian Installer daily image, you surely know it much
  better than I do. :)  The host is a Lenny system with the Etch kernel:

I am using Lenny with a standard Lenny kernel.

$ uname -a
Linux hostname 2.6.26-2-xen-amd64 #1 SMP Wed Mar 10 00:29:48 UTC 2010 x86_64 
GNU/Linux

 I think the issue is with the host's Xen utilities rather than the
 Debian Installer image which makes it tricky to fix in Lenny. I believe
 it works with the Xen utilities in Squeeze.

Should this bug be reassigned then?

 For Lenny you could workaround by downloading the kernel and ramdisk
 locally and use the install-kernel= and install-ramdisk= options to
 xm-debian.cfg, or if you have a local mirror you could just use
 install-installer=.

Unfortunately that work-around does not work for me.

$ ls -l /tmp/{vmlinuz,initrd.gz}
-rw-r--r-- 1 user user 17859729 2010-08-10 10:05 /tmp/initrd.gz
-rw-r--r-- 1 user user  2351776 2010-08-10 10:05 /tmp/vmlinuz
$ sudo xm create /tmp/xm-debian.cfg install=true 
install-mirror=ftp://ftp.de.debian.org/debian 
install-installer=http://people.debian.org/~joeyh/d-i/images/daily/ 
install-suite=squeeze install-kernel=/tmp/vmlinuz install-ramdisk=/tmp/initrd.gz
Using config file /tmp/xm-debian.cfg.
Install Mirror: ftp://ftp.de.debian.org/debian
Install Suite: squeeze
Installer: http://people.debian.org/~joeyh/d-i/images/daily/

WARNING: Installer kernel and ramdisk are not authenticated.

Fetching /tmp/vmlinuz
Fetching /tmp/initrd.gz
command line is debian-installer/exit/always_halt=true -- quiet 
console=hvc0
Error: Kernel image does not exist: /tmp/vmlinuz

Do you have any ideas?


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part


Bug#560348: xen: racy temporary files for kernel and initrd

2010-08-10 Thread Ian Campbell
On Tue, 2010-08-10 at 15:40 +0200, Paul Menzel wrote:
 Am Montag, den 21.12.2009, 09:19 + schrieb Ian Campbell:
  On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
   
   The guest is the Debian Installer daily image, you surely know it much
   better than I do. :)  The host is a Lenny system with the Etch kernel:
 
 I am using Lenny with a standard Lenny kernel.
 
 $ uname -a
 Linux hostname 2.6.26-2-xen-amd64 #1 SMP Wed Mar 10 00:29:48 UTC 2010 x86_64 
 GNU/Linux
 
  I think the issue is with the host's Xen utilities rather than the
  Debian Installer image which makes it tricky to fix in Lenny. I believe
  it works with the Xen utilities in Squeeze.
 
 Should this bug be reassigned then?
 
  For Lenny you could workaround by downloading the kernel and ramdisk
  locally and use the install-kernel= and install-ramdisk= options to
  xm-debian.cfg, or if you have a local mirror you could just use
  install-installer=.
 
 Unfortunately that work-around does not work for me.
 
 $ ls -l /tmp/{vmlinuz,initrd.gz}
 -rw-r--r-- 1 user user 17859729 2010-08-10 10:05 /tmp/initrd.gz
 -rw-r--r-- 1 user user  2351776 2010-08-10 10:05 /tmp/vmlinuz
 $ sudo xm create /tmp/xm-debian.cfg install=true 
 install-mirror=ftp://ftp.de.debian.org/debian 
 install-installer=http://people.debian.org/~joeyh/d-i/images/daily/ 
 install-suite=squeeze install-kernel=/tmp/vmlinuz 
 install-ramdisk=/tmp/initrd.gz
 Using config file /tmp/xm-debian.cfg.
 Install Mirror: ftp://ftp.de.debian.org/debian
 Install Suite: squeeze
 Installer: http://people.debian.org/~joeyh/d-i/images/daily/
 
 WARNING: Installer kernel and ramdisk are not authenticated.
 
 Fetching /tmp/vmlinuz
 Fetching /tmp/initrd.gz
 command line is debian-installer/exit/always_halt=true -- quiet 
 console=hvc0
 Error: Kernel image does not exist: /tmp/vmlinuz
 
 Do you have any ideas?

It's not clear looking back over the bug that anyone ever actually tried
the workaround, rather than hypothesising it. Unfortunately I don't have
a suitable Lenny system to hand.

You could try install-kernel=file:///

Alternatively you can always use your own configuration file (like you
would for a non-Debian domain) with none of this clever stuff in it,
i.e. just set kernel= and ramdisk= to static paths to run the installer
and then change it to use bootloader=pygrub afterwards. e.g. I often use
as a template:

#  -*- mode: python; -*-

bootloader = /usr/bin/pygrub

vcpus = 2

memory = 128

name = d32-1
vif = [ 'mac=00:16:3E:74:34:76' ]
disk = ['phy:/dev/VG/debian-x86_32-1,xvda,w']

hostname = debian-1

tsc_mode=2
extra = xencons=hvc console=hvc0 ro root=/dev/xvda1 #

# Install...
#extra = debian-installer/exit/always_halt=true --  + extra
#kernel = /scratch/lenny/i386/vmlinuz
#ramdisk = /scratch/lenny/i386/initrd.gz

and uncomment the 3 lines at the end to do installs then recomment them
afterwards.

TBH I've come to the realisation that the xm-debian.cfg stuff was too
clever for its own good. With hindsight better solutions would have been
install-debian.sh, something compatible with the Xen bootloader option
or even just properly documenting the settings to be used in the
configuration file.

The complex python code in configuration files functionality of Xen is
likely to go away in a future upstream release so I really need to
revisit this and implement one of the other options, fortunately it
isn't necessary for Squeeze.

Ian.
-- 
Ian Campbell

God is real, unless declared integer.




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2010-08-10 Thread Paul Menzel
Am Dienstag, den 10.08.2010, 15:10 +0100 schrieb Ian Campbell:
 On Tue, 2010-08-10 at 15:40 +0200, Paul Menzel wrote:
  Am Montag, den 21.12.2009, 09:19 + schrieb Ian Campbell:
   On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:

The guest is the Debian Installer daily image, you surely know it much
better than I do. :)  The host is a Lenny system with the Etch kernel:
  
  I am using Lenny with a standard Lenny kernel.
  
  $ uname -a
  Linux hostname 2.6.26-2-xen-amd64 #1 SMP Wed Mar 10 00:29:48 UTC 2010 
  x86_64 GNU/Linux
  
   I think the issue is with the host's Xen utilities rather than the
   Debian Installer image which makes it tricky to fix in Lenny. I believe
   it works with the Xen utilities in Squeeze.
  
  Should this bug be reassigned then?
  
   For Lenny you could workaround by downloading the kernel and ramdisk
   locally and use the install-kernel= and install-ramdisk= options to
   xm-debian.cfg, or if you have a local mirror you could just use
   install-installer=.
  
  Unfortunately that work-around does not work for me.
  
  $ ls -l /tmp/{vmlinuz,initrd.gz}
  -rw-r--r-- 1 user user 17859729 2010-08-10 10:05 /tmp/initrd.gz
  -rw-r--r-- 1 user user  2351776 2010-08-10 10:05 /tmp/vmlinuz
  $ sudo xm create /tmp/xm-debian.cfg install=true 
  install-mirror=ftp://ftp.de.debian.org/debian 
  install-installer=http://people.debian.org/~joeyh/d-i/images/daily/ 
  install-suite=squeeze install-kernel=/tmp/vmlinuz 
  install-ramdisk=/tmp/initrd.gz
  Using config file /tmp/xm-debian.cfg.
  Install Mirror: ftp://ftp.de.debian.org/debian
  Install Suite: squeeze
  Installer: http://people.debian.org/~joeyh/d-i/images/daily/
  
  WARNING: Installer kernel and ramdisk are not authenticated.
  
  Fetching /tmp/vmlinuz
  Fetching /tmp/initrd.gz
  command line is debian-installer/exit/always_halt=true -- quiet 
  console=hvc0
  Error: Kernel image does not exist: /tmp/vmlinuz
  
  Do you have any ideas?
 
 It's not clear looking back over the bug that anyone ever actually tried
 the workaround, rather than hypothesising it. Unfortunately I don't have
 a suitable Lenny system to hand.
 
 You could try install-kernel=file:///

That did not work either.

[…]
Fetching file:///tmp/vmlinuz
Fetching file:///tmp/initrd.gz
command line is debian-installer/exit/always_halt=true -- quiet
console=hvc0
Error: Kernel image does not exist: /tmp/vmlinuz

 Alternatively you can always use your own configuration file (like you
 would for a non-Debian domain) with none of this clever stuff in it,
 i.e. just set kernel= and ramdisk= to static paths to run the installer
 and then change it to use bootloader=pygrub afterwards. e.g. I often use
 as a template:
 
 #  -*- mode: python; -*-
 
 bootloader = /usr/bin/pygrub
 
 vcpus = 2
 
 memory = 128
 
 name = d32-1
 vif = [ 'mac=00:16:3E:74:34:76' ]
 disk = ['phy:/dev/VG/debian-x86_32-1,xvda,w']
 
 hostname = debian-1
 
 tsc_mode=2
 extra = xencons=hvc console=hvc0 ro root=/dev/xvda1 #
 
 # Install...
 #extra = debian-installer/exit/always_halt=true --  + extra
 #kernel = /scratch/lenny/i386/vmlinuz
 #ramdisk = /scratch/lenny/i386/initrd.gz
 
 and uncomment the 3 lines at the end to do installs then recomment them
 afterwards.

Thank you for your suggestion. Unfortunately I get the following error
message.

$ sudo xm create /tmp/squeeze.cfg
Using config file /tmp/squeeze.cfg.
Error: Boot loader didn't return any data!
$ ls -l /usr/bin/pygrub 
lrwxrwxrwx 1 root root 29 2010-06-15 10:51 /usr/bin/pygrub - 
/usr/lib/xen-3.2-1/bin/pygrub
$ dpkg -S /usr/lib/xen-3.2-1/bin/pygrub 
xen-utils-3.2-1: /usr/lib/xen-3.2-1/bin/pygrub
$ dpkg -l xen-utils-3.2-1
ii  xen-utils-3.2- 3.2.1-2XEN administrative tools

But reading [1] and your comment before I commented the bootloader line
too.

$ grep vmlinuz /tmp/squeeze.cfg 
kernel = /tmp/vmlinuz
$ sudo xm create /tmp/squeeze.cfg
Using config file /tmp/squeeze.cfg.
Error: Kernel image does not exist: /tmp/vmlinuz

Do you have any idea? This is with the daily Debian Installer files from
[2].

[…]


Thanks,

Paul


[1] http://wiki.xensource.com/xenwiki/PyGrub
[2] http://people.debian.org/~joeyh/d-i/images/daily/netboot/xen/


signature.asc
Description: This is a digitally signed message part


Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-21 Thread Ian Campbell
On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
 
 The guest is the Debian Installer daily image, you surely know it much
 better than I do. :)  The host is a Lenny system with the Etch kernel:

I think the issue is with the host's Xen utilities rather than the
Debian Installer image which makes it tricky to fix in Lenny. I believe
it works with the Xen utilities in Squeeze.

For Lenny you could workaround by downloading the kernel and ramdisk
locally and use the install-kernel= and install-ramdisk= options to
xm-debian.cfg, or if you have a local mirror you could just use
install-installer=.

Ian.

-- 
Ian Campbell

My friend has a baby.  I'm writing down all the noises he makes so
later I can ask him what he meant.
-- Steven Wright




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-21 Thread Ferenc Wagner
Ian Campbell i...@hellion.org.uk writes:

 On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
 
 The guest is the Debian Installer daily image, you surely know it much
 better than I do. :)  The host is a Lenny system with the Etch kernel:

 I think the issue is with the host's Xen utilities rather than the
 Debian Installer image which makes it tricky to fix in Lenny.

Isn't xm-debian.cfg part of the Debian Installer?  I feel like it
wanders into undefined territory by using temporary files with
uncontrolled life cycles.  But I accept that the Lenny tools probably
just don't provide the necessary facilities.

 I believe it works with the Xen utilities in Squeeze.

Good to hear.

 For Lenny you could workaround by downloading the kernel and ramdisk
 locally and use the install-kernel= and install-ramdisk= options to
 xm-debian.cfg, or if you have a local mirror you could just use
 install-installer=.

Yes.  At least this is documented now. :)
-- 
Thanks,
Feri.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-21 Thread Ian Campbell
On Mon, 2009-12-21 at 11:56 +0100, Ferenc Wagner wrote:
 Ian Campbell i...@hellion.org.uk writes:
 
  On Fri, 2009-12-11 at 11:30 +0100, Ferenc Wagner wrote:
  
  The guest is the Debian Installer daily image, you surely know it much
  better than I do. :)  The host is a Lenny system with the Etch kernel:
 
  I think the issue is with the host's Xen utilities rather than the
  Debian Installer image which makes it tricky to fix in Lenny.
 
 Isn't xm-debian.cfg part of the Debian Installer?  I feel like it
 wanders into undefined territory by using temporary files with
 uncontrolled life cycles.

Yes that is probably true. I tried to find a way to solve this issue
purely within the xm-debian.cfg file which worked with the Lenny tools
but I couldn't find one that didn't leak the downloaded file.

   But I accept that the Lenny tools probably
 just don't provide the necessary facilities.

  For Lenny you could workaround by downloading the kernel and ramdisk
  locally and use the install-kernel= and install-ramdisk= options to
  xm-debian.cfg, or if you have a local mirror you could just use
  install-installer=.
 
 Yes.  At least this is documented now. :)

It was always documented at the top of xm-debian.cfg.

Ian.

-- 
Ian Campbell
Current Noise: Zakk Wylde - The Color Green

You can do more with a kind word and a gun than with just a kind word.
-- Al Capone




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-21 Thread Ferenc Wagner
Ian Campbell i...@hellion.org.uk writes:

 On Mon, 2009-12-21 at 11:56 +0100, Ferenc Wagner wrote:

 Ian Campbell i...@hellion.org.uk writes:
 
 For Lenny you could workaround by downloading the kernel and ramdisk
 locally and use the install-kernel= and install-ramdisk= options to
 xm-debian.cfg, or if you have a local mirror you could just use
 install-installer=.
 
 Yes.  At least this is documented now. :)

 It was always documented at the top of xm-debian.cfg.

Oh, I meant the race condition with the Lenny tools, not the options
themselves.
-- 
Thanks,
Feri.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-11 Thread Ferenc Wagner
Ian Campbell i...@hellion.org.uk writes:

 On Thu, 2009-12-10 at 17:46 +0100, Ferenc Wagner wrote:
 
 The current code in xm-debian.cfg uses Python-managed temporary files,
 which are unlinked too early (in parallel with the RPC call).  I can't
 recommend a good solution, and maybe it's already fixed in the current
 (version 3.4) tools.

 I noticed this a little while ago and began investigating a solution
 using the upstream data:// URI support (see xen-unstable
 20117:4fc6ff1e1141) but then I upgraded to Xen 3.4 and the issue went
 away.

 Can you please confirm what your host and guest Debian versions are as
 well as which hypervisor+tools you see this with.

The guest is the Debian Installer daily image, you surely know it much
better than I do. :)  The host is a Lenny system with the Etch kernel:

$ cat /etc/debian_version 
5.0.3

$ uname -a
Linux xen2-ha 2.6.18-6-xen-686 #1 SMP Thu Nov 5 19:54:42 UTC 2009 i686 GNU/Linux

$ apt-cache policy linux-image-2.6.18-6-xen-686 xen-hypervisor-3.2-1-i386 
xen-utils-3.2-1 xen-utils-common
linux-image-2.6.18-6-xen-686:
  Installed: 2.6.18.dfsg.1-26etch1
  Candidate: 2.6.18.dfsg.1-26etch1
  Version table:
 *** 2.6.18.dfsg.1-26etch1 0
500 http://security.debian.org etch/updates/main Packages
100 /var/lib/dpkg/status
 2.6.18.dfsg.1-24 0
500 http://ftp.hu.debian.org etch/main Packages
xen-hypervisor-3.2-1-i386:
  Installed: 3.2.1-2
  Candidate: 3.2.1-2
  Version table:
 *** 3.2.1-2 0
500 http://ftp.hu.debian.org lenny/main Packages
100 /var/lib/dpkg/status
xen-utils-3.2-1:
  Installed: 3.2.1-2
  Candidate: 3.2.1-2
  Version table:
 *** 3.2.1-2 0
500 http://ftp.hu.debian.org lenny/main Packages
100 /var/lib/dpkg/status
xen-utils-common:
  Installed: 3.2.0-2
  Candidate: 3.2.0-2
  Version table:
 *** 3.2.0-2 0
500 http://ftp.hu.debian.org lenny/main Packages
100 /var/lib/dpkg/status
 3.0.3-0-2 0
500 http://ftp.hu.debian.org etch/main Packages

$ sudo xm info
host   : xen2-ha
release: 2.6.18-6-xen-686
version: #1 SMP Thu Nov 5 19:54:42 UTC 2009
machine: i686
nr_cpus: 4
nr_nodes   : 1
cores_per_socket   : 1
threads_per_core   : 2
cpu_mhz: 3056
hw_caps: bfebfbff:::0080:4400
total_memory   : 3071
free_memory: 2781
node_to_cpu: node0:0-3
xen_major  : 3
xen_minor  : 2
xen_extra  : -1
xen_caps   : xen-3.0-x86_32p 
xen_scheduler  : credit
xen_pagesize   : 4096
platform_params: virt_start=0xf580
xen_changeset  : unavailable
cc_compiler: gcc version 4.3.1 (Debian 4.3.1-2) 
cc_compile_by  : waldi
cc_compile_domain  : debian.org
cc_compile_date: Sat Jun 28 15:25:00 UTC 2008
xend_config_format : 4


 AFAIR this worked on Lenny (where I developed it) and now it works
 again on Sid (and so I expect it will work again on Squeeze eventually
 if it doesn't already).

I can't easily test anything else but this Lenny host, but there seems
to be some problem there.  Btw. I noticed that the temporary files are
unlinked twice (the first unlink belongs to some unrelated weirdness,
the first column is the PID):

$ fgrep unlink notexists2.strace
14124 unlink(/tmp/hL5gTk) = 0
14131 unlink(/tmp/tmp8kZcOJ)  = 0
14131 unlink(/tmp/tmpZmbQSd.gz)   = 0
14124 unlink(/tmp/tmp8kZcOJ)  = -1 ENOENT (No such file or directory)
14124 unlink(/tmp/tmpZmbQSd.gz)   = -1 ENOENT (No such file or directory)
-- 
Thanks,
Feri.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-10 Thread Ferenc Wagner
Package: debian-installer
Version: 20090123lenny4
Severity: normal

Hi,

I encountered this while testing daily snapshots under Xen 3.2 with long
extra command lines (you may consider this sort of preseeding stupid, but
that's not the point now):

$ sudo xm create -c xm-debian.cfg install=true 
install-installer=http://people.debian.org/~joeyh/d-i/images/daily
Using config file ./xm-debian.cfg.
Install Mirror: http://ftp.debian.org/debian
Install Suite: squeeze
Installer: http://people.debian.org/~joeyh/d-i/images/daily

WARNING: Installer kernel and ramdisk are not authenticated.

Fetching http://people.debian.org/~joeyh/d-i/images/daily/netboot/xen/vmlinuz
Fetching http://people.debian.org/~joeyh/d-i/images/daily/netboot/xen/initrd.gz
command line is debian-installer/exit/always_halt=true DEBIAN_FRONTEND=text 
debian-installer/locale=en_HU console-keymaps-at/keymap=us 
netcfg/disable_dhcp=true netcfg/get_nameservers=xxx.xxx.xxx.xxx 
xxx.xxx.xxx.xxx netcfg/get_ipaddress=xxx.xxx.xxx.xxx 
netcfg/get_netmask=xxx.xxx.xxx.xxx netcfg/get_gateway=xxx.xxx.xxx.xxx 
netcfg/get_hostname=unassigned-hostname netcfg/get_domain=unassigned-domain 
netcfg/confirm_static=true 
anna/choose_modules=network-console,openssh-client-udeb 
network-console/password=xxx network-console/password-again=xxx 
network-console/start= mirror/country=manual 
mirror/http/hostname=ftp.xxx.debian.org mirror/http/directory=/debian 
mirror/http/proxy= passwd/make-user=false popularity-contest/participate=false 
tasksel:tasksel/first= -- quiet console=hvc0
Error: Kernel image does not exist: /tmp/tmp8kZcOJ

Strace revealed that the temporary files holding the kernel and the initrd
are unlinked before the RPC call to start the domain is done:

14124 write(1, command line is \debian-installer..., 786) = 786
14124 clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7e1e6f8) 
= 14131
14124 select(0, NULL, NULL, NULL, {1, 0} unfinished ...
14131 unlink(/tmp/tmp8kZcOJ)  = 0
14131 unlink(/tmp/tmpZmbQSd.gz)   = 0
14131 socket(PF_FILE, SOCK_STREAM, 0)   = 3
14131 connect(3, {sa_family=AF_FILE, path=/var/run/xend/xmlrpc.sock...}, 27) 
= 0

A successful run goes like this instead:

15434 write(1, command line is \debian-installer..., 79) = 79
15434 clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7e106f8) 
= 15451
15434 select(0, NULL, NULL, NULL, {1, 0} unfinished ...
15451 socket(PF_FILE, SOCK_STREAM, 0)   = 3
15451 connect(3, {sa_family=AF_FILE, path=/var/run/xend/xmlrpc.sock...}, 27) 
= 0
15451 send(3, POST /RPC2 HTTP/1.0\r\nHost: \r\nUser..., 133, 0) = 133
15451 send(3, ?xml version='1.0'?\nmethodCall..., 2376, 0) = 2376
15451 recv(3, H..., 1, 0) = 1
15451 recv(3, T..., 1, 0) = 1
15451 recv(3, T..., 1, 0) = 1
15451 recv(3, P..., 1, 0) = 1
[...]
15451 recv(3, \n..., 1, 0)= 1
15451 recv(3, \r..., 1, 0)= 1
15451 recv(3, \n..., 1, 0)= 1
15451 unlink(/tmp/tmpazBx1R)  = 0
15451 unlink(/tmp/tmpJxsmb5.gz)   = 0
15451 recv(3, ?xml version='1.0'?\nmethodResp..., 1024, 0) = 1024

The current code in xm-debian.cfg uses Python-managed temporary files,
which are unlinked too early (in parallel with the RPC call).  I can't
recommend a good solution, and maybe it's already fixed in the current
(version 3.4) tools.

Thanks,
Feri.

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560348: xen: racy temporary files for kernel and initrd

2009-12-10 Thread Ian Campbell
On Thu, 2009-12-10 at 17:46 +0100, Ferenc Wagner wrote:
 
 The current code in xm-debian.cfg uses Python-managed temporary files,
 which are unlinked too early (in parallel with the RPC call).  I can't
 recommend a good solution, and maybe it's already fixed in the current
 (version 3.4) tools.

I noticed this a little while ago and began investigating a solution
using the upstream data:// URI support (see xen-unstable
20117:4fc6ff1e1141) but then I upgraded to Xen 3.4 and the issue went
away.

Can you please confirm what your host and guest Debian versions are as
well as which hypervisor+tools you see this with. AFAIR this worked on
Lenny (where I developed it) and now it works again on Sid (and so I
expect it will work again on Squeeze eventually if it doesn't already).

Ian.

-- 
Ian Campbell

Life sucks, but death doesn't put out at all.
-- Thomas J. Kopp


signature.asc
Description: This is a digitally signed message part