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

Don't hang waiting for input from commands #2231

Closed
ubuntu-server-builder opened this issue May 9, 2023 · 3 comments
Closed

Don't hang waiting for input from commands #2231

ubuntu-server-builder opened this issue May 9, 2023 · 3 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #903993

Launchpad details
affected_projects = ['cloud-init (Ubuntu)']
assignee = smoser
assignee_name = Scott Moser
date_closed = 2012-04-11T04:10:01.293495+00:00
date_created = 2011-12-13T23:09:24.184811+00:00
date_fix_committed = 2011-12-20T01:38:03.876110+00:00
date_fix_released = 2012-04-11T04:10:01.293495+00:00
id = 903993
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/903993
milestone = None
owner = clint-fewbar
owner_name = Clint Byrum
private = False
status = fix_released
submitter = mazurek-4
submitter_name = Drew Mazurek
tags = ['hang', 'stdin']
duplicates = []

Launchpad user Drew Mazurek(mazurek-4) wrote on 2011-12-13T23:09:24.184811+00:00

If a command is interactive and opens up stdin, the entire deploy will hang. cloud-init should close stdin if anything tries to open it. Examples of this are:

  • apt-add-repository ppa:xxx/yyy

or

  • apt-get install foo

(Specifically without the -y option. -y on those commands would be a workaround for this bug.)

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 9, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Clint Byrum(clint-fewbar) wrote on 2011-12-16T21:44:40.580295+00:00

This makes sense to me. Its simpler even than you suggest. I see no good reason that cloud-init ever should read from stdin, so it should probably just re-open stdin as /dev/null. Any program that hangs waiting for input from a non tty like /dev/null is doing things wrong, or is being invoked incorrectly.

I don't see this as High though, as it can be worked around by not running programs that wait for input from stdin. Dropping to Medium, and forwarding to cloud-init upstream project.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2011-12-19T22:03:38.613759+00:00

fix-commited in upstream cloud-init at revision 490.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Launchpad Janitor(janitor) wrote on 2011-12-22T09:10:13.291010+00:00

This bug was fixed in the package cloud-init - 0.6.3~bzr497-0ubuntu1


cloud-init (0.6.3~bzr497-0ubuntu1) precise; urgency=low

  • New upstream snapshot.
    • cloud-config support for configuring apt-proxy
    • selection of local mirror based on presense of 'ubuntu-mirror' dns
      entry in local domain. (LP: #897688)
    • DataSourceEc2: more resilliant to slow metadata service (LP: #894279)
    • close stdin in all programs launched by cloud-init (LP: #903993)
    • revert management of /etc/hosts to 0.6.1 style (LP: #890501, LP: #871966)
    • write full ssh keys to console for easy machine consumption (LP: #893400)
    • put INSTANCE_ID environment variable in bootcmd scripts
    • add 'cloud-init-per' script for easily running things with a given freq
      (this replaced cloud-init-run-module)
    • support configuration of landscape-client via cloud-config (LP: #857366)
    • part-handlers now get base64 decoded content rather than 2xbase64 encoded
      in the payload parameter. (LP: #874342)
      -- Scott Moser smoser@ubuntu.com Thu, 22 Dec 2011 04:07:38 -0500

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

No branches or pull requests

1 participant