Error in sudoers list - centos

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?

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.

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!

Related

postgresql command not working; Error: invalid option '-o'

I am trying to fix this previous error when I am unable to find the PostgreSQL client library, however, when I run the suggested command:
ridk exec sh -c "pacman -S ${MINGW_PACKAGE_PREFIX}-postgresql"
I get this error. Not sure how to fix, any help is appreciated
error: invalid option '-o'
I tried the other suggestions such as:
gem install pg -- --with-pg-config=/path/to/pg_config
But I still get the same error.

Nohup command cause an error

I follow some tutorial about queuing on laravel and run it on the background, with this command
sudo nohup php artisan queue:work --daemon --tries=3
After awhile, i want to update my code, with command
git add .
but i got this error
error: open("nohup.out"): Permission denied
error: unable to index file nohup.out
fatal: adding files failed
I assume it comes from above command.
How can i solve this?
thanks man, really confused now!
Sorry for late,
Can you see that file to include? I say if you use:
git status
Then if you cant, try with chmod 777 to give all permissions.

Matlab startup error permission denied

The error message is as follows. How to deal with this trouble?
Error using connector.internal.autostart.run
Cannot CD to C:\Users\dell\AppData\Local\Temp (Directory permission
denied).
The following worked for me:
1 - Go into the MATLAB installation directory using terminal.
2 - Change installation file type in the sense of permission and execution:
sudo chmod +x install
3 - Run installer:
sudo ./install
Apparently the aforementioned method provides permission in the necessary steps.

-bash: sudo: command not found with godaddy

I'm trying to install ElasticSearch with godaddy hosting, but it's keep getting me this error:
-bash: sudo: command not found
echo $PATH
/usr/local/jdk/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/cpanel/composer/bin:/opt/puppetlabs/bin:/opt/dell/srvadmin/bin:/usr/local/bin:/usr/X11R6/bin:/home/bingoladmin/.local/bin:/home/bingoladmin/bin
Linux distribution Red hat

Windows command line tar "cannot connect to d: resolve failed" with Chef Knife

Using Windows Command line with cygwin, chef and ruby installed. When trying
knife cookbook site install mysql
returns the following error
Begin output of tar zxvf D:/path/to/chef-repo/cookbooks/mysql.tar.gz
STDOUT:
STDERR: tar<child>: Cannot connect to D: resolve failed
gzip: stdin: undexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now</code>
How can I remedy this issue? I can manually unzip using
tar zxvf mysql.tar.gz
but this is less than ideal. I believe this has to do with the colon in filename but how can I change that in the knife or chef preferences?
The reason is that tar interprets colons (:) in file names as meaning it is a file on another machine. You can disable this behavior by using the flag --force-local.
This is from an answer from here.
I don't know a complete answer but have been seeing this on Linux machines lately:
$ date > today
$ tar -czf - today > to:day.tgz
$ tar -tzf to:day.tgz
ssh: connect to host to port 22: Connection refused
tar (child): to\:day.tgz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now
gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now
$ tar -tzf - < to:day.tgz
today
$
It appears that tar wants to do some sort of remote file processing because of the colon in the file name and you can fake it out by using some form of redirection or piping - for both reading and writing a tarball. I would still like to find an option or something to tell tar not to behave this way.
Will the tar command work if ran from cmd? Also what if the output is to a local drive. Something else try this,
tar zxvf "D:/path/to/chef-repo/cookbooks/mysql.tar.gz"