Hi,
from your log:
[...]
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.lst file ... 
Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst 
generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read: 
read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1

The code there is:
        else
                echo -n "Would you like $menu_file generated for you? " >&2
                echo -n "(y/N) " >&2
                read answer <&2
        fi

That would usually work fine, example:
$ cat test.sh 
#!/bin/bash
answer="foo"
read answer <&2
echo ${answer}

$ ./test.sh 
asd
asd

But when run withou disconnected stdin/out it will fail like that.
$ nohup ./test.sh
nohup: ignoring input and appending output to 'nohup.out'
$ cat nohup.out 
./test.sh: line 3: read: read error: 0: Bad file descriptor
foo


I must admit I never have seen ain input &2 so far.
So I wonder what it does in that case
  read answer <&2
@smoser - do you know?

In any case it should probably be more resilent against stdin missing.
As it already has a default value and my test showed that with the error it is 
kept we might just add "|| true" to make a fail to read non-fatal for the 
overall execution.
@smoser - opinion on this suggestion?

I subscribed smoser for his experience on this.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1786244

Title:
  package linux-image-4.15.0-24-generic (not installed) failed to
  install/upgrade: run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2
  exited with return code 1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub-legacy-ec2/+bug/1786244/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to