Closed coderforlife closed 2 years ago
This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been labeled as stale for 7 days with no activity.
It doesn't look like this has been fixed yet. Are you open to accepting a PR for this?
I spent quite a bit of time figuring out what was going on here :(
I spent quite a bit of time figuring out what was going on here :(
Yes, I'll be looking at this PR. Please don't be sad. I just have a lot going on right now. :)
As for this issue being closed, I thought I "saved it" by removing the stale tag and assigning it to myself on Jan 1 2022. But I don't think I realized at the time that the issue had also been closed (not just marked stale).
Describe the bug
bootstrap.d scripts that are run by the contrib/bootstrap script have no tty (i.e. the command
tty
reportsnot a tty
) and no standard input (i.e. usingread
orselect
always get no input).To reproduce
not a tty
then<>
without ever getting a value from the userLots of similar examples can be created, if doing a loop that validates user's input, it will just go forever. If using
select
it will give up after a few iterations automatically.Expected behavior
The commands
read
andselect
(and anything reading from stdin) to wait for user input or take whatever user input is given toyadm
command. The user-interactiveness is partially expected since when doingyadm clone ...
it usesread
itself right before running the bootstrap script!Workarounds and Solutions
Doing
exec </dev/tty
in the bootstrap.d script gets the stdin back from the terminal, but will lose any redirects the user themselves did.The real solution is to replace the line:
with
which creates the array properly without messing with
IFS
and having an in-useread
while calling other scripts.Environment