萬盛學電腦網

 萬盛學電腦網 >> Linux教程 >> BSD多用戶圖形腳本/etc/rc.d/rc.5

BSD多用戶圖形腳本/etc/rc.d/rc.5

  BSD多用戶圖形腳本/etc/rc.d/rc.5

  5級只是在2級基礎上追加圖形功能,所以先復制一份,代碼如下。

  cp /etc/rc.d/rc.2 /etc/rc.d/rc.5

  /etc/rc.d/rc.5追加部分

  追加部分查看kdm,gdm,xdm是否存在,存在其一則啟動圖形界面。否則轉到2級登陸界面。

  echo "Starting graphical login manager..."

  if [ -x /opt/kde/bin/kdm ]; then

  /opt/kde/bin/kdm -nodaemon

  elif [ -x /usr/bin/gdm ]; then

  /usr/bin/gdm -nodaemon

  elif [ -x /usr/X11R6/bin/xdm ]; then

  /usr/X11R6/bin/xdm -nodaemon

  else

  echo "You chose to start graphical login mode, but you don't have either KDM or"

  echo "GDM or XDM installed. This script looks for these display managers in the"

  echo "following locations:"

  echo

  echo " KDM /opt/kde/bin/kdm"

  echo " GDM /usr/bin/gdm"

  echo " XDM /usr/X11R6/bin/xdm"

  echo

  echo "This message will go away in 10 seconds, and after that you will be dropped"

  echo "in runlevel 2."

  sleep 10

  /sbin/telinit 2

  fi

copyright © 萬盛學電腦網 all rights reserved