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