The main problem that you need a password less sudo user to be able install devstack. Try to run: devstack/tools/create-stack-user.sh After that it should work.
Error in sudoers list
题
I have been trying to install Openstack on centos using devstack. When I run the script, I get the following error:
[vagrant@centos64 devstack]$ ./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
Now, here is /etc/sudoers.d/50_stack_sh file:
[root@centos64 devstack]# 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
I tried to edit it, but it says it's a read only buffer, even for root user. I tried to add vagrant user to the sudoers group by editing /etc/sudoers file, but it gave the same error as it is a read only buffer. How do I resolve this error?
解决方案
其他提示
To recap the context:
- I have installed CentOS 7 (1503) minimal.
As root:
I ran the command:
git clone https://git.openstack.org/openstack-dev/devstack
I ran the command
devstack/tools/create-stack-user.sh
: it created a stack user and create the file/etc/sudoers.d/50_stack_sh
. But that file has syntax error.To fix it, I edit the file
/etc/sudoers.d/50_stack_sh
to have this content:stack ALL=(ALL) NOPASSWD: ALL Defaults secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin Defaults !requiretty
To force the saving with VIM, you need to type
:w!
Hope it helps,
I had this problem as well. It wasn't a problem with the stack.sh script, as you can run something (as the stack user) like "sudo yum update" and it will produce the same problem.
It comes from a syntax error in the /etc/sudoers.d/50_stack_sh file. You can get away with running (as root)
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
My stack.sh seems to be working well now
There is my way to fix it.
I cd to the /etc/sudoers.d/
,and then delete the file 50_stack_sh.
It works,and now your user can good work.You can change to the user which you want to run devstack and run the script ./stack.sh
.
Hope it helps!