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

sudo timeouts during installs #15

Open
seanknox opened this issue Feb 4, 2016 · 4 comments
Open

sudo timeouts during installs #15

seanknox opened this issue Feb 4, 2016 · 4 comments

Comments

@seanknox
Copy link
Contributor

seanknox commented Feb 4, 2016

Hi there,

Having run dev-setup on a few machines now (thanks! loving it so far) I've noticed that installs require typing the sudo password at various points, making unattended installs impossible.

A solution we used in Boxen for this problem was to ask for the user's sudo password at the beginning (using sudo -p) and periodically call sudo -p to prevent timeout or prompt the user again. Happy to put up a PR if you're interested.

@donnemartin
Copy link
Owner

Hi Sean,

Great to hear from you again! Appreciate your continued help with keeping dev-setup updated.

It's been awhile since I've done a clean install, although I think I recall on my runs the following was sufficient for an unattended install:

# Ask for the administrator password upfront.
sudo -v

# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

It seems this isn't working for all cases and we need additional keep alives?


On a perhaps related note, there are a couple scripts aws.sh and pydata.sh that specifically do not pip install with sudo which might be causing this issue:

# Removed user's cached credentials
# This script might be run with .dots, which uses elevated privileges
sudo -K

If this is the culprit, maybe these two scripts should be run at the end of .dots.

-Donne

@seanknox
Copy link
Contributor Author

seanknox commented Feb 4, 2016

Hey Donne,

I encountered password prompts in at least three places running ./dots all:

  • During installation of bash_completion:
==> ./configure --prefix=/usr/local/Cellar/bash-completion2/2.1_2 --sysconfdir=/usr/local/etc
==> make install
==> Caveats
Add the following to your ~/.bash_profile:
  if [ -f $(brew --prefix)/share/bash-completion/bash_completion ]; then
    . $(brew --prefix)/share/bash-completion/bash_completion
  fi

  Homebrew's own bash completion script has been linked into
    /usr/local/share/bash-completion/completions
  bash-completion will automatically source it when you invoke `brew`.

  Any completion scripts in /usr/local/etc/bash_completion.d
  will continue to be sourced as well.
==> Summary
🍺  /usr/local/Cellar/bash-completion2/2.1_2: 387 files, 764.6K, built in 54 seconds
Adding the newly installed shell to the list of allowed shells
Password:
  • Installation of Alfred via brew cask
  • Data store setup

@donnemartin
Copy link
Owner

Ok, thanks for the additional info.

Happy to put up a PR if you're interested.

Sure, that would be great!

@josephmilla
Copy link

Update on this?

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

No branches or pull requests

3 participants