Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tee /dev/tty error during vagrant build #227

Open
iMingLei opened this issue Feb 11, 2017 · 2 comments
Open

tee /dev/tty error during vagrant build #227

iMingLei opened this issue Feb 11, 2017 · 2 comments

Comments

@iMingLei
Copy link

iMingLei commented Feb 11, 2017

There is the same error that happened 3 times related to the code below through vagrant build.

Vagrant\oxar\utils\download.sh
Line 19: DOWNLOAD_OUTPUT=$(curl -L -O -C - ${download_path} --progress-bar 2> >(tee /dev/tty))

errors are as below:

==> default:
==> default: * Loading configurations *
==> default: tee: /dev/tty: No such device or address
==> default:
... ...
==> default: * Installing ratom *
==> default: which: no ratom in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin)
==> default: tee: /dev/tty: No such device or address
... ...
==> default: * Installing Oracle XE *
==> default: tee: /dev/tty: No such device or address
==> default: /var/tmp/rpm-tmp.miszrM: line 257: [: 18446744073692774399: integer expression expected
==> default: /var/tmp/rpm-tmp.miszrM: line 271: [: 18446744073692774399: integer expression expected

I guess the main idea for this snippet is to use tee to redirect stderror to /dev/tty. Somehow, with vagrant build, in this command substitution sub-shell, tee can not find /dev/tty in vagrant ssh.

@iMingLei
Copy link
Author

iMingLei commented Feb 11, 2017

According to the method in build.sh, redirecting stderror to ${OOS_ERROR_LOG} will fix this error. Test passed through vagrant build.

  D:\zVMS\Vagrant\oxar\utils\download.sh 
  Line 19: 
- DOWNLOAD_OUTPUT=$(curl -L -O -C - ${download_path} --progress-bar 2> >(tee /dev/tty))
+ DOWNLOAD_OUTPUT=$(curl -L -O -C - ${download_path} --progress-bar 2> >(tee ${OOS_ERROR_LOG} --append))

But not sure if the progress bar from curl will display or not through native build . Need testing...

iMingLei added a commit to iMingLei/OXAR that referenced this issue Feb 12, 2017
@iMingLei iMingLei changed the title tee /dev/tty error tee /dev/tty error during vagrant build Feb 12, 2017
@iMingLei
Copy link
Author

iMingLei commented Feb 12, 2017

If changing to code below, progress bar will show but line by line on terminal as well as in the log file. Not recommended.
DOWNLOAD_OUTPUT=$(curl -L -O -C - ${download_path} --progress-bar 2> >(tee ${OOS_ERROR_LOG} --append 1>&2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant