Chef infra 运行“厨师长客户端”时出现的问题;sudo“;命令vs";苏";

Chef infra 运行“厨师长客户端”时出现的问题;sudo“;命令vs";苏";,chef-infra,sudo,Chef Infra,Sudo,两种情况。我正在使用chef客户端在节点上安装MYSQL: 1) 在第一个场景中,我将其作为“sudo”运行: 2) 在第二个场景中,从相同的起点重新创建上面的VM,它成功了,没有任何错误: sudo su - chef-client 后一个场景成功,没有与ldconfig相关的错误 因此,我很困惑为什么chef客户端的sudo命令不起作用,而第二个命令没有问题?它可能是shell环境中的某个东西。从su的手册页面: -l Simulate a full login. The

两种情况。我正在使用chef客户端在节点上安装MYSQL:

1) 在第一个场景中,我将其作为“sudo”运行:

2) 在第二个场景中,从相同的起点重新创建上面的VM,它成功了,没有任何错误:

sudo su - 
chef-client
后一个场景成功,没有与ldconfig相关的错误


因此,我很困惑为什么chef客户端的sudo命令不起作用,而第二个命令没有问题?

它可能是shell环境中的某个东西。从su的手册页面:

 -l      Simulate a full login.  The environment is discarded except for HOME, SHELL, PATH, TERM, and USER.  HOME and SHELL are modified as
         above.  USER is set to the target login.  PATH is set to ``/bin:/usr/bin''.  TERM is imported from your current environment.  The
         invoked shell is the target login's, and su will change directory to the target login's home directory.

 -       (no letter) The same as -l.

运行
su-
会抛出环境的内容,而sudo不会。更确切地说,它保留了一些东西,这是关于ldconfig命令试图做的任何事情的抛掷。

这都是关于环境的。它们是根本不同的东西。
 -l      Simulate a full login.  The environment is discarded except for HOME, SHELL, PATH, TERM, and USER.  HOME and SHELL are modified as
         above.  USER is set to the target login.  PATH is set to ``/bin:/usr/bin''.  TERM is imported from your current environment.  The
         invoked shell is the target login's, and su will change directory to the target login's home directory.

 -       (no letter) The same as -l.