-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
runas from cmd.run in a state on mac doesn't use the correct PATH #53857
Comments
Maybe we should use sudo to get the correct path, then use su to switch user, and then set the path correctly, and then run the command. Although I don't know how well that would work with different shells. |
this issue appears to break rbenv.installed |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Thank you for updating this issue. It is no longer marked as stale. |
Description of Issue
on mac, using su -l does not use the login shell's path but changes it to /bin:/usr/bin
Salt uses something like:
su -l [user here] -c "[command here]"
to implement runas which means that when it runs the command, the path is set to /bin:/usr/bin which breaks a lot of things.
Steps to Reproduce Issue
run a state similar to
where custom_thing is somewhere like /usr/local/bin/custom_thing
Possible solutions
We could do something like
under the hood on mac as that uses the correct path.
Versions Report
Salt Version:
Salt: 2018.3.4
Dependency Versions:
cffi: 1.11.2
cherrypy: 13.0.0
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.7
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: 2.18
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.14 (default, Feb 7 2019, 13:30:25)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 17.0.0
RAET: Not Installed
smmap: 2.0.5
timelib: 0.2.4
Tornado: 4.5.2
ZMQ: 4.1.6
System Versions:
dist:
locale: UTF-8
machine: x86_64
release: 17.7.0
system: Darwin
version: 10.13.6 x86_64
The text was updated successfully, but these errors were encountered: