rvmsudo passenger-status command not found #1307

Closed
sprack opened this Issue Nov 11, 2012 · 7 comments

4 participants

@sprack

rvmsudo passenger-status returns:
sudo: passenger-status: command not found

Ubuntu 12.04 sudoer's file contains:
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Commenting out the secure_path line allows it to run correctly.

@richo
Ruby enVironment Manager member

RVM can't go messing with sudoers. What does

rvmsudo /full/path/to/passenger-status

Do? Correct behaviour?

I'll consider a patch that looks up RVM's gem path internally.

@mpapis
Ruby enVironment Manager member

@richo I was thinking about:

if grep -E '^[[:space:]]*Defaults[[:space:]]+secure_path=' >/dev/null
then sudo_args+=("/usr/bin/env")
fi

just before the eval line https://github.com/wayneeseguin/rvm/blob/master/binscripts/rvmsudo#L34

maybe with:

rvm_warn "Warning: secure_path found in /etc/sudoers, falling back to call via /usr/bin/env, this is known to break rules from /etc/sudoers"
@richo
Ruby enVironment Manager member

Sounds good, but I would add a check for __rvm_secure_level first and stub it out with __rvm_secure_level() { return 0 } for now, I have an idea for how a user can lock this down.

I can hack on it a bit tonight.

@mpapis
Ruby enVironment Manager member

as there is easy workaround for this (commenting out secure_path) - there is no hurry with a fix

@richo richo was assigned Nov 11, 2012
@mpapis mpapis closed this in da39895 Nov 12, 2012
@HappySoft

Is it fixed?

$ rvm -v

rvm 1.17.6 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

$ rvmsudo passenger-status
sudo: passenger-status: command not found

@mpapis
Ruby enVironment Manager member

@HappySoft try after rvm get head - not all fixes are added to teeny version changes

@HappySoft

@mpapis Thank you, it works!

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