Lightdm 在 Ubuntu 14.04 启动时不启动

Lightdm 在 Ubuntu 14.04 启动时不启动

我已经阅读了很多关于此问题的帖子,这些帖子与 Ubuntu 以前版本有关,但它们似乎对我的情况不起作用。

在启动时,/var/log/boot.log 中显示守护进程 /usr/sbin/lightdm 直接关闭 - 似乎没有任何明显错误,只剩下“Kubuntu”在对我笑。然后,如果我启动终端,登录并执行“service lightdm start”,它就会完美启动。

我尝试了一些“丑陋的黑客”来使其启动,例如在 init 脚本“/etc/init.d/lightdm”服务 lightdm start 或 /etc/init.d/lightdm start 中添加底线,但它仍然不会在启动时启动。所有其他显示管理器(gdm 和 kdm)都已卸载。

有任何想法吗?

#!/bin/sh

# Largely adapted from xdm's init script:
# Copyright 1998-2002, 2004, 2005 Branden Robinson <[email protected]>.
# Copyright 2006 Eugene Konev <[email protected]>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# This is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian operating system, in /usr/share/common-licenses/GPL;  if
# not, write to the Free Software Foundation, Inc., 51 Franklin Street, 
# Fifth Floor, Boston, MA 02110-1301, USA.

### BEGIN INIT INFO
# Provides:          lightdm
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      $named acpid hal
# Should-Stop:       $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start lightdm
### END INIT INFO

set -e

HEED_DEFAULT_DISPLAY_MANAGER=
# To start lightdm even if it is not the default display manager, change
# HEED_DEFAULT_DISPLAY_MANAGER to "false."
# Also overridable from command line like:
# HEED_DEFAULT_DISPLAY_MANAGER=false /etc/init.d/lightdm start
[ -z "$HEED_DEFAULT_DISPLAY_MANAGER" ] && HEED_DEFAULT_DISPLAY_MANAGER=true

DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/lightdm
PIDFILE=/var/run/lightdm.pid

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

test -x $DAEMON || exit 0

. /lib/lsb/init-functions

SSD_START_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --startas $DAEMON -- -d"
SSD_STOP_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --retry TERM/5/TERM/5"

case "$1" in
  start)
    if [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
       [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
       [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "/usr/bin/lightdm" -a "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "/usr/sbin/lightdm" ]; then
      echo "Not starting X display manager (lightdm); it is not the default" \
        "display manager."
    else
      log_daemon_msg "Starting X display manager" "lightdm"
      start-stop-daemon --start --quiet $SSD_START_ARGS \
        || log_progress_msg "already running"
      log_end_msg 0
    fi
  ;;

  restart)
    [ -f $PIDFILE ] && /etc/init.d/lightdm stop
    [ -f $PIDFILE ] && exit 1
    /etc/init.d/lightdm start
  ;;

  stop)
    log_daemon_msg "Stopping X display manager" "lightdm"
    if ! [ -f $PIDFILE ]; then
      log_progress_msg "not running ($PIDFILE not found)"
    else
      start-stop-daemon --stop --quiet $SSD_STOP_ARGS
      SSD_RES=$?
      if [ $SSD_RES -eq 1 ]; then
        log_progress_msg "not running"
      fi
      if [ $SSD_RES -eq 2 ]; then
        log_progress_msg "not responding to TERM signals"
      else
    if [ -f $PIDFILE ]; then
      log_progress_msg "(removing stale $PIDFILE)"
      rm $PIDFILE
    fi
      fi
    fi
    log_end_msg 0
  ;;
  force-reload)
    /etc/init.d/lightdm restart
  ;;

  *)
    echo "Usage: /etc/init.d/lightdm {start|stop|restart|force-reload}"
    exit 1
    ;;
esac
exit 0

答案1

现在,当我研究 /var/log/Xorg.0.log 时,发现了一些错误:

$ cat Xorg.0.log | grep EE

[    94.517] (EE) open /dev/dri/card0: No such file or directory
[    97.226] (EE) AIGLX error: failed to open /usr/X11R6/lib/modules/dri/fglrx_dri.so, error[/usr/X11R6/lib/modules/dri/fglrx_dri.so: cannot open shared object file: No such file or directory]
[   873.817] (EE) Server terminated successfully (0). Closing log file.

该问题分两步解决:

  1. sudo mkdir -p /usr/X11R6/lib/modules/dri然后在同一目录中,

  2. sudo ln -s /usr/lib/fglrx/dri/fglrx_dri.so

不幸的是 lightdm 仍然无法在启动时启动 :(

但是在文本模式下执行以下命令并可能使用标志-f是解决问题的第一步:

sudo update-rc.d lightdm remove 
sudo update-rc.d lightdm defaults
sudo update-rc.d lightdm enable

彻底解决问题的最后一步是编辑 中的/etc/init.d/lightdm以下行:

HEED_DEFAULT_DISPLAY_MANAGER=true

改为,

HEED_DEFAULT_DISPLAY_MANAGER=false

重启后,lightdm 启动正常:)

相关内容