[xen-tools] 30-disable-gettys doesn't work when /bin/sh is dash

Martijn Koster mak-xentools at greenhills.co.uk
Sat Mar 31 07:21:34 CEST 2007


Bug report: 30-disable-gettys doesn't work when /bin/sh is dash

I was experimenting with xen-tools in Ubuntu feisty.
I wanted a feisty domU, so I copied the edgy.d to feisty.d,
and that created an install, but when I did "xm create -c",
I saw the console, but I didn't get a login prompt.

It turns out that this is because 30-disable-gettys has:

  #!/bin/sh
  ...
  rm ${prefix}/etc/event.d/tty[^1]

and that ^ pattern matching isn't supported by sh. In most systems
where /bin/sh is bash, that's not a problem. But in my Ubuntu feisty
/bin/sh links to dash rather than bash, and it has effectively the
oppostive effect:

  $ touch a1 a2 a3; /bin/bash -c 'rm ./a[^1]'; ls a?
  a1
  $ touch a1 a2 a3; /bin/dash -c 'rm ./a[^1]'; ls a?
  a2  a3

I ended up with tty2 - tty6, and no tty1.

I checked the script in the latest downloadable version 3.2, and it
is still present. That script needs to either use #!/bin/bash, or it
needs to achieve the deletes a different way, perhaps:

  for x in 2 3 4 5 6 7 8 9;
  do
    if [ -f ${prefix}/etc/event.d/tty$x ]; then
      rm ${prefix}/etc/event.d/tty$x;
    fi
  done

Thanks,

-- Martijn





More information about the xen-tools-discuss mailing list