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

knife bootstrap now requiring sudo #8814

Open
robbkidd opened this issue Aug 13, 2019 · 4 comments

Comments

@robbkidd
Copy link
Member

commented Aug 13, 2019

(opening on behalf of a user in the Community Slack)

Description

knife bootstrap has started requiring sudo on the target host. It should not.

Chef Version

Reporting user reported Chef 15.2.20.

sudo appears to have become a requirement in #8795 (in commit 104f68b).

Platform Version

Reporting user was targeting a Debian host that does not have sudo.

This also affects FreeBSD.

@vsingh-msys

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

Hi @robbkidd & @tas50 working on it to resolve sudo issue with AIX node as well as part of #8764.
Looking for changing the owner without sudo in AIX or for other hosts.

@KrisShannon

This comment has been minimized.

Copy link

commented Aug 13, 2019

@vsingh-msys If you look at the code before b595d89 you can see it uses two separate calls to run_command!

Does it work on AIX if you do that?

e.g. something like:

cmd = "mkdir -p %s" % dir
run_command!(cmd)
# Ensure that dir has the correct owner.  We are possibly
# running with sudo right now - so this directory would be owned by root.
# File upload is performed over SCP as the current logged-in user,
# so we'll set ownership to ensure that works.
cmd = "chown #{config[:user]} '#{dir}'"
run_command!(cmd)
@vsingh-msys

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

@KrisShannon Above code fails if we provide --sudo options because dir created with root privilege.

Provided fix #8815 which will work for all host.

Thanks!

@zedtux

This comment has been minimized.

Copy link

commented Aug 14, 2019

Thank you @robbkidd 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.