在CentOS上安装devstack的时候遇到:
[stack@localhost ~]$ ./stack.sh
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 1 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 2 <<<
sudo: parse error in /etc/sudoers.d/50_stack_sh near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 1 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 2 <<<
sudo: parse error in /etc/sudoers.d/50_stack_sh near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 1 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 2 <<<
sudo: parse error in /etc/sudoers.d/50_stack_sh near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 1 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 2 <<<
sudo: parse error in /etc/sudoers.d/50_stack_sh near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 1 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 2 <<<
sudo: parse error in /etc/sudoers.d/50_stack_sh near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
RDO repo not detected; installing
++ proxychains /usr/bin/yum.bin install http://rdo.fedorapeople.org/openstack-havana/rdo-release-havana.rpm
ProxyChains-3.1 (http://proxychains.sf.net)
Loaded plugins: fastestmirror
You need to be root to perform this command.
[Call Trace]
./stack.sh:224:die
[ERROR] ./stack.sh:224 Error installing RDO repo, cannot continue
切换到 root 用户,
会看到有这么一个文件 /etc/sudoers.d/50_stack_sh
[root@localhost stack]# cat /etc/sudoers.d/50_stack_sh
ALL=(root) NOPASSWD:ALL
Defaults: secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin
这个文件是在安装devstack之前,创建调用下面命令创建stack用户时生成的:
./tools/create-stack-user.sh
只需把这个文件改一下即可,
stack ALL=(ALL) NOPASSWD: ALL
Defaults secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin
Defaults !requiretty