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

Neil Wilson neil at aldur.co.uk
Sat Mar 31 08:39:49 CEST 2007


That's my fault - mixed my regex and shell expansion again. :-(

Can you try 

rm ${prefix}/etc/event.d/tty[!1]

which should then be POSIX compliant.

NeilW

-----Original Message-----
From: xen-tools-bounce at lists.cvsrepository.org
[mailto:xen-tools-bounce at lists.cvsrepository.org]On Behalf Of Martijn
Koster
Sent: 31 March 2007 06:22
To: xen-tools at lists.cvsrepository.org
Subject: [xen-tools] 30-disable-gettys doesn't work when /bin/sh is dash


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