Devstack create null environment variables when a user no privilege.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
devstack |
Invalid
|
Undecided
|
Sam Su | ||
Fedora |
New
|
Undecided
|
Unassigned |
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
[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
[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/
3. Create the 'stack' user
[root@server175 devstack]# /root/devstack/
Giving stack user passwordless sudo privileges
4. check the result after run create-
[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.)
[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/devstack/
./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.
[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.
Changed in devstack: | |
assignee: | nobody → Sam Su (sam-su) |
Changed in devstack: | |
status: | New → In Progress |
Changed in devstack: | |
status: | Invalid → New |
Changed in devstack: | |
status: | Invalid → Confirmed |
This looks like the first major issue is that your devstack checkout is in /root.
Getting create- stack-user. sh is a bit of a chicken-and-egg problem, I'd suggest re-cloning the devstack repo after logging in as the 'stack' user in that home directory.