Ubuntu 登录屏幕重新加载

Ubuntu 登录屏幕重新加载

在更新了一堆软件包并重新启动后,我尝试登录我的 Ubuntu 桌面。我知道我已成功验证身份,但似乎发生了这样的情况:在我输入用户名和密码后,屏幕暂时变为全黑,然后再次加载登录页面。

我不知道在哪里可以找到与此相关的错误。任何建议都将不胜感激。


更新: 如果我failsafe GNOME从会话列表中选择,我可以正常登录。有什么想法吗?


更新2: 以下是 的输出~/.xsession-errors

/etc/gdm/Xsession: Beginning session setup...
/etc/profile.d/p4c.sh: 8: Syntax error: "(" unexpected

p4c.sh这是我从以前的 Ubuntu 系统复制的脚本 - 它在以前运行良好。以下是 p4c.sh 的内容:

#!/bin/bash

# p4c() function setup params
p4_HOST=`hostname | awk -F . '{print $1}'`

# function for setting the P4CLIENT variable based on the first non-option
# argument provided
function p4client() {
    HELP_MODE=''
    VERBOSE_MODE=''
    DESC_MODE=''
    SHORT_MODE=''
    while getopts ":hdsv" option
    do
        case $option in
            h) echo "p4c provides information about perforce clients."
               echo "Recognized arguments:"
               echo "    -h     help (this message)"
               echo "    -d     descriptions (prints client descriptions - useful, but slightly slower)"
               echo "    -v     verbose (print unreasonable amounts of debugging info"
               echo
               # About to exit - reset OPTIND or we'll be in trouble later.
               OPTIND=1
               # Abort
               return
               ;;
            v) VERBOSE_MODE='verbose';;
            d) DESC_MODE='descriptions';;
            s) SHORT_MODE='short';;
            *) echo "Unknown option '$OPTARG'!  Specify -h for help..."
               # About to exit - reset OPTIND or we'll be in trouble later.
               OPTIND=1
               # Abort
               return
               ;;
        esac
    done

    # Set argument pointer to first non-option argument
    shift $(($OPTIND - 1))

    # Done with OPTIND - better reset it before something bad happens...
    OPTIND=1

    PROJECT=$1;
    if [ $VERBOSE_MODE ]
    then
        echo "PROJECT: $PROJECT"
    fi

    # Need to check/set p4_USER every time to allow changes between invocations
    if [ -z "$p4c_USER" ]
    then
        p4_USER=`echo $P4USER`
        if [ -z "$p4_USER" ]
        then
            p4_USER=`id -nu`
        fi
    else
        p4_USER=$p4c_USER
    fi
    if [ $VERBOSE_MODE ]
    then
        echo "p4_USER: $p4_USER"
    fi


    if [ -n "$PROJECT" ]
    then
        # provided a non empty string project name
        p4_CLIENT=$p4_HOST-$p4_USER-$PROJECT
        if [ $VERBOSE_MODE ]
        then
            echo "p4_CLIENT: $p4_CLIENT"
        fi

        # check client to see if it exists
        p4_GREP_RESULT=`p4 clients | grep "$p4_CLIENT"`
        if [ -z "$p4_GREP_RESULT" ]
        then
            echo "NOTE: P4 client \"$p4_CLIENT\" does not exist on server."
            echo "Setting P4CLIENT anyway so that client \"$p4_CLIENT\" can be created."
            echo
        fi

        export P4CLIENT=$p4_CLIENT;
    else
        # check for client matches
        p4_GREP_RESULT=`p4 clients | egrep "($p4_HOST-$p4_USER-|$p4_USER-$p4_HOST-)" | awk '{print $2;}'`
        echo "Known workspaces for user $p4_USER, host $p4_HOST:"
        if [ -z

答案1

您应该删除该行中的function关键字或括号()。这在不同版本中的实现有点不一致bash--- 可能是您的更新引入了一些不兼容的版本bash

为我

nameofsomefunction() {
   ...
}

大部分时间都有效。

相关内容