Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.10.0
-
Fix Version/s: None
-
Component/s: Chef Client
-
Labels:None
Description
Users frequently want to be able to "run a script as a user" where the script will run the same as if they logged in as that user or su'd to it. In the current implementation, only the uid (and gid, if a group is given) are changed. So there should be a login(true) option to the bash resource. It needs to do the following (at least) to emulate being the logged in user:
- clear the PATH
- determine the user's HOME from the Etc module and set $HOME to that value
- Run bash as bash -l
This should cause the correct profile and rc files to be read, making the script run in a login-like environment.
Issue Links
- is duplicated by
-
CHEF-1523
User is not set properly in execute/script resources
-
-
CHEF-2517
$HOME not set correctly
-
-
CHEF-2948
"execute" resource and more generally mixlib-shellout may fail due to lack of proper USER or HOME environment variables in subprocess
-
- relates to
-
CHEF-2417
Deploy revision resource runs as the user invoking 'chef-client'
-
Activity
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
|
586d 9h 38m | 1 | ${tran.lastUpdater} | 05/Dec/12 9:40 AM | |||||
|
7d 12h 20m | 1 | ${tran.lastUpdater} | 12/Dec/12 10:00 PM | |||||
|
89d 40m | 1 | Bryan McLellan [Opscode] | 11/Mar/13 10:41 PM |