issues running chef-client under "sudo" command vs "su" -


two scenarios. installing mysql on node using chef-client:

1) in first scenario run "sudo":

sudo chef-client  [2/5/14 6:30:31 pm] xxxx : : xxx:  * execute[ldconfig] action run ================================================================================ error executing action `run` on resource 'execute[ldconfig]' ================================================================================ [2/5/14 6:30:41 pm] xxxx : : xxx: when run again "chef-client" works [2/5/14 6:30:48 pm] xxxx : : xxx: running as: sudo chef-client [2/5/14 6:31:15 pm] xxxx : : xxx: errno::enoent ------------- no such file or directory - ldconfig 

2) on second scenario, recreating vm above same starting point, succeeds without errors:

sudo su -  chef-client 

the later scenario successfull, no errors related ldconfig.

therefore, confused why sudo command chef-client not work, whereas second 1 has no issues ?

it's in environment of shell. manual page su:

 -l      simulate full login.  environment discarded except home, shell, path, term, , user.  home , shell modified          above.  user set target login.  path set ``/bin:/usr/bin''.  term imported current environment.           invoked shell target login's, , su change directory target login's home directory.   -       (no letter) same -l. 

running su - throws out contents of environment , sudo not. rather it's keeping around that's throwing off whatever ldconfig command trying do.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -