Ubuntu 在 OpenStack 中安装 DevStack 时收到错误

Ubuntu 在 OpenStack 中安装 DevStack 时收到错误
  1. Ubuntu 在 OpenStack 中安装 DevStack 时收到错误。

    stack@denny-pc:~$ cd /opt/devstack/`
    `
    stack@denny-pc:/opt/devstack$ ./stack.sh 
    `
    `
    

    文件权限:

    -rwxr-xr-x  1 root root 43892 1 month   8 18:35 stack.sh*
    
  2. 当到达第 605 行时,显示以下消息:

    +./stack.sh:read_password:605              set +o xtrace
    touch: cannot touch '/opt/devstack/.localrc.password': Permission denied
    Error on exit
    Traceback (most recent call last):
      File "/opt/devstack/tools/worlddump.py", line 22, in <module>
        from distutils import spawn
    ImportError: cannot import name 'spawn'
    
  3. stack.sh 的第 605 行内容如下:

    # Generic helper to configure passwords
    function read_password {
        local xtrace
        xtrace=$(set +o | grep xtrace)
        set +o xtrace
        var=$1; msg=$2
        pw=${!var}
    
        if [[ -f $RC_DIR/localrc ]]; then
            localrc=$TOP_DIR/localrc
        else
            localrc=$TOP_DIR/.localrc.password
        fi
    
      # If the password is not defined yet, proceed to prompt user for a password.
        if [ ! $pw ]; then
            # If there is no localrc file, create one
            if [ ! -e $localrc ]; then
                touch $localrc
            fi
    
            # Presumably if we got this far it can only be that our
            # localrc is missing the required password.  Prompt user for a
            # password and write to localrc.
    
            echo ''
            echo '################################################################################'
            echo $msg
            echo '################################################################################'
            echo "This value will be written to ${localrc} file so you don't have to enter it "
            echo "again.  Use only alphanumeric characters."
       echo "If you leave this blank, a random default value will be used."
            pw=" "
            while true; do
                echo "Enter a password now:"
                read -e $var
                pw=${!var}
                [[ "$pw" = "`echo $pw | tr -cd [:alnum:]`" ]] && break
                echo "Invalid chars in password.  Try again:"
            done
            if [ ! $pw ]; then
                pw=$(generate_hex_string 10)
            fi
            eval "$var=$pw"
            echo "$var=$pw" >> $localrc
        fi
        # restore previous xtrace value
        $xtrace
    }
    
  4. 主要错误信息:

    touch: cannot touch '/opt/devstack/.localrc.password': Permission denied
    

造成这个问题的原因是什么?

相关内容