If a user ran into the wrong way, the user should have a chance to go back. If nobody care about the situation, I had a bug fixed for the situation for your reference.
-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Koteswara Rao Kelam
Sent: Thursday, September 04, 2014 3:16 PM
To: Sam Su
Subject: [Bug 1316326] Re: Devstack create null environment variables when a user no privilege.
but as Sam Su said, by mistake if we ran into this situation, how do we recover?
i also ran into this situation. I removed devstack and cloned it again as user stack but still i am not able to run stack.sh
console o/p:
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 0 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 1 <<<
sudo: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 3 <<<
sudo: parse error in /etc/sudoers.d/50_stack_sh near line 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
2. Execute devstack in root
[root@server175 ~]# cd devstack && ./stack.sh
You are running this script as root.
Cut it out.
Really.
If you need an account to run DevStack, do this (as root, heh) to create stack:
/root/devstack/tools/create-stack-user.sh
3. Create the 'stack' user
[root@server175 devstack]# /root/devstack/tools/create-stack-user.sh
Giving stack user passwordless sudo privileges
4. check the result after run create-stack-user.sh
[root@server175 devstack]# cat /etc/sudoers.d/50_stack_sh
stack ALL=(ALL) NOPASSWD:ALL
5. Switch to the stack user
[root@server175 devstack]# su stack
6. Execute the ./stack.sh and get the return "no permission", add a small debug code to echo $STACK_USER (here should be "stack" instead of NULL.)
[stack@server175 devstack]$ ./stack.sh
./stack.sh: line 41: /root/devstack/functions: Permission denied
./stack.sh: line 44: /root/devstack/lib/config: Permission denied
./stack.sh: line 49: GetDistro: command not found
rm: cannot remove `/root/devstack/.localrc.auto': Permission denied
./stack.sh: line 98: log_error: command not found
/root/devstack/stackrc
./stack.sh: line 101: /root/devstack/stackrc: Permission denied
./stack.sh: line 108: export_proxy_variables: command not found
./stack.sh: line 126: log_error: command not found
./stack.sh: line 132: log_error: command not found
./stack.sh: line 136: /root/devstack/lib/database: Permission denied
./stack.sh: line 137: /root/devstack/lib/rpc_backend: Permission denied
./stack.sh: line 142: disable_negated_services: command not found
WARNING: this script has not been tested on
./stack.sh: line 149: die: command not found
./stack.sh: line 163: check_rpc_backend: command not found
./stack.sh: line 175: trueorfalse: command not found
./stack.sh: line 195: is_package_installed: command not found
./stack.sh: line 195: install_package: command not found
*********************
STACK_USER =
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: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 3 <<<
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
./stack.sh: line 262: safe_chown: command not found
./stack.sh: line 263: safe_chmod: command not found
./stack.sh: line 266: check_path_perm_sanity: command not found
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: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 3 <<<
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: >>> /etc/sudoers.d/50_stack_sh: syntax error near line 3 <<<
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
./stack.sh: line 278: safe_chown: command not found
./stack.sh: line 287: trueorfalse: command not found
./stack.sh: line 292: trueorfalse: command not found
./stack.sh: line 295: trueorfalse: command not found
./stack.sh: line 305: get_default_host_ip: command not found
./stack.sh: line 307: die: command not found
./stack.sh: line 317: trueorfalse: command not found
./stack.sh: line 325: trueorfalse: command not found
./stack.sh: line 339: /root/devstack/lib/apache: Permission denied
./stack.sh: line 342: /root/devstack/lib/tls: Permission denied
./stack.sh: line 345: /root/devstack/lib/infra: Permission denied
./stack.sh: line 346: /root/devstack/lib/oslo: Permission denied
./stack.sh: line 347: /root/devstack/lib/stackforge: Permission denied
./stack.sh: line 348: /root/devstack/lib/horizon: Permission denied
./stack.sh: line 349: /root/devstack/lib/keystone: Permission denied
./stack.sh: line 350: /root/devstack/lib/glance: Permission denied
./stack.sh: line 351: /root/devstack/lib/nova: Permission denied
./stack.sh: line 352: /root/devstack/lib/cinder: Permission denied
./stack.sh: line 353: /root/devstack/lib/swift: Permission denied
./stack.sh: line 354: /root/devstack/lib/ceilometer: Permission denied
./stack.sh: line 355: /root/devstack/lib/heat: Permission denied
./stack.sh: line 356: /root/devstack/lib/neutron: Permission denied
./stack.sh: line 357: /root/devstack/lib/baremetal: Permission denied
./stack.sh: line 358: /root/devstack/lib/ldap: Permission denied
./stack.sh: line 435: initialize_database_backends: command not found
No database enabled
./stack.sh: line 441: is_service_enabled: command not found
./stack.sh: line 449: is_service_enabled: command not found
./stack.sh: line 475: is_service_enabled: command not found
Installing package prerequisites...done
7. the reason is the stack user cannot list the folder root, however stack.sh should not create any NULL environment variables when failed.
[stack@server175 devstack]$ source /root/devstack/stackrc
bash: /root/devstack/stackrc: Permission denied
[stack@server175 devstack]$
My suggestion is Devstack stack.sh should check the return code to
import environments, when failed, stack.sh should exit.
Totally agree.
If a user ran into the wrong way, the user should have a chance to go back. If nobody care about the situation, I had a bug fixed for the situation for your reference.
https:/ /review. openstack. org/#/c/ 92227/
-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Koteswara Rao Kelam
Sent: Thursday, September 04, 2014 3:16 PM
To: Sam Su
Subject: [Bug 1316326] Re: Devstack create null environment variables when a user no privilege.
but as Sam Su said, by mistake if we ran into this situation, how do we recover?
i also ran into this situation. I removed devstack and cloned it again as user stack but still i am not able to run stack.sh
console o/p: d/50_stack_ sh: syntax error near line 0 <<< d/50_stack_ sh: syntax error near line 1 <<< d/50_stack_ sh: syntax error near line 3 <<< d/50_stack_ sh near line 0
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: parse error in /etc/sudoers.
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
-- /bugs.launchpad .net/bugs/ 1316326
You received this bug notification because you are subscribed to the bug report.
https:/
Title:
Devstack create null environment variables when a user no privilege.
Status in devstack - openstack dev environments:
Invalid
Bug description:
Hi,
I am devstack return user and I am trying to run devstack to install a
openstack cluster, but failed because null environment variables.
Here is my reproduce steps:
1. download devstack /github. com/openstack- dev/devstack. git .git/
[root@server175 ~]# git clone https:/
Initialized empty Git repository in /root/devstack/
remote: Reusing existing pack: 17740, done.
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 17754 (delta 4), reused 1 (delta 0)
Receiving objects: 100% (17754/17754), 4.68 MiB | 1.65 MiB/s, done.
Resolving deltas: 100% (12150/12150), done.
2. Execute devstack in root devstack/ tools/create- stack-user. sh
[root@server175 ~]# cd devstack && ./stack.sh
You are running this script as root.
Cut it out.
Really.
If you need an account to run DevStack, do this (as root, heh) to create stack:
/root/
3. Create the 'stack' user tools/create- stack-user. sh
[root@server175 devstack]# /root/devstack/
Giving stack user passwordless sudo privileges
4. check the result after run create- stack-user. sh d/50_stack_ sh
[root@server175 devstack]# cat /etc/sudoers.
stack ALL=(ALL) NOPASSWD:ALL
5. Switch to the stack user
[root@server175 devstack]# su stack
6. Execute the ./stack.sh and get the return "no permission", add a small debug code to echo $STACK_USER (here should be "stack" instead of NULL.) functions: Permission denied lib/config: Permission denied devstack/ .localrc. auto': Permission denied devstack/ stackrc stackrc: Permission denied proxy_variables : command not found lib/database: Permission denied lib/rpc_ backend: Permission denied negated_ services: command not found installed: command not found ******* ******* ** d/50_stack_ sh: syntax error near line 1 <<< d/50_stack_ sh: syntax error near line 2 <<< d/50_stack_ sh: syntax error near line 3 <<< d/50_stack_ sh near line 1 perm_sanity: command not found d/50_stack_ sh: syntax error near line 1 <<< d/50_stack_ sh: syntax error near line 2 <<< d/50_stack_ sh: syntax error near line 3 <<< d/50_stack_ sh near line 1 d/50_stack_ sh: syntax error near line 1 <<< d/50_stack_ sh: syntax error near line 2 <<< d/50_stack_ sh: syntax error near line 3 <<< d/50_stack_ sh near line 1 host_ip: command not found lib/apache: Permission denied lib/tls: Permission denied lib/infra: Permission denied lib/oslo: Permission denied lib/stackforge: Permission denied lib/horizon: Permission denied lib/keystone: Permission denied lib/glance: Permission denied lib/nova: Permission denied lib/cinder: Permission denied lib/swift: Permission denied lib/ceilometer: Permission denied lib/heat: Permission denied lib/neutron: Permission denied lib/baremetal: Permission denied lib/ldap: Permission denied database_ backends: command not found ..done
[stack@server175 devstack]$ ./stack.sh
./stack.sh: line 41: /root/devstack/
./stack.sh: line 44: /root/devstack/
./stack.sh: line 49: GetDistro: command not found
rm: cannot remove `/root/
./stack.sh: line 98: log_error: command not found
/root/
./stack.sh: line 101: /root/devstack/
./stack.sh: line 108: export_
./stack.sh: line 126: log_error: command not found
./stack.sh: line 132: log_error: command not found
./stack.sh: line 136: /root/devstack/
./stack.sh: line 137: /root/devstack/
./stack.sh: line 142: disable_
WARNING: this script has not been tested on
./stack.sh: line 149: die: command not found
./stack.sh: line 163: check_rpc_backend: command not found
./stack.sh: line 175: trueorfalse: command not found
./stack.sh: line 195: is_package_
./stack.sh: line 195: install_package: command not found
*****
STACK_USER =
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: parse error in /etc/sudoers.
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
./stack.sh: line 262: safe_chown: command not found
./stack.sh: line 263: safe_chmod: command not found
./stack.sh: line 266: check_path_
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: parse error in /etc/sudoers.
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: >>> /etc/sudoers.
sudo: parse error in /etc/sudoers.
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
./stack.sh: line 278: safe_chown: command not found
./stack.sh: line 287: trueorfalse: command not found
./stack.sh: line 292: trueorfalse: command not found
./stack.sh: line 295: trueorfalse: command not found
./stack.sh: line 305: get_default_
./stack.sh: line 307: die: command not found
./stack.sh: line 317: trueorfalse: command not found
./stack.sh: line 325: trueorfalse: command not found
./stack.sh: line 339: /root/devstack/
./stack.sh: line 342: /root/devstack/
./stack.sh: line 345: /root/devstack/
./stack.sh: line 346: /root/devstack/
./stack.sh: line 347: /root/devstack/
./stack.sh: line 348: /root/devstack/
./stack.sh: line 349: /root/devstack/
./stack.sh: line 350: /root/devstack/
./stack.sh: line 351: /root/devstack/
./stack.sh: line 352: /root/devstack/
./stack.sh: line 353: /root/devstack/
./stack.sh: line 354: /root/devstack/
./stack.sh: line 355: /root/devstack/
./stack.sh: line 356: /root/devstack/
./stack.sh: line 357: /root/devstack/
./stack.sh: line 358: /root/devstack/
./stack.sh: line 435: initialize_
No database enabled
./stack.sh: line 441: is_service_enabled: command not found
./stack.sh: line 449: is_service_enabled: command not found
./stack.sh: line 475: is_service_enabled: command not found
Installing package prerequisites.
7. the reason is the stack user cannot list the folder root, however stack.sh should not create any NULL environment variables when failed. stackrc stackrc: Permission denied
[stack@server175 devstack]$ source /root/devstack/
bash: /root/devstack/
[stack@server175 devstack]$
My suggestion is Devstack stack.sh should check the return code to
import environments, when failed, stack.sh should exit.
To manage notifications about this bug go to: /bugs.launchpad .net/devstack/ +bug/1316326/ +subscriptions
https:/