From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RTZ3m-0004Qw-6X for garchives@archives.gentoo.org; Thu, 24 Nov 2011 13:09:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1FBC221C078; Thu, 24 Nov 2011 13:09:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D49FA21C078 for ; Thu, 24 Nov 2011 13:09:42 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 202191B400E for ; Thu, 24 Nov 2011 13:09:42 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2265) id 664EF2004C; Thu, 24 Nov 2011 13:09:40 +0000 (UTC) From: "Chi-Thanh Christopher Nguyen (chithanh)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, chithanh@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in x11-base/xorg-server/files: xdm.initd-5 X-VCS-Repository: gentoo-x86 X-VCS-Files: xdm.initd-5 X-VCS-Directories: x11-base/xorg-server/files X-VCS-Committer: chithanh X-VCS-Committer-Name: Chi-Thanh Christopher Nguyen Content-Type: text/plain; charset=utf8 Message-Id: <20111124130940.664EF2004C@flycatcher.gentoo.org> Date: Thu, 24 Nov 2011 13:09:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: cfca1c7d-42a6-4085-9253-8982d3510dcf X-Archives-Hash: 7e4e5b6bbe512027247f99c116e3ebdb chithanh 11/11/24 13:09:40 Added: xdm.initd-5 Log: Change "after dbus" to "use dbus", bug #327257, bug #390609, and bug #3= 91275. =20 (Portage version: 2.2.0_alpha77/cvs/Linux x86_64) Revision Changes Path 1.1 x11-base/xorg-server/files/xdm.initd-5 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-base/xorg-serv= er/files/xdm.initd-5?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-base/xorg-serv= er/files/xdm.initd-5?rev=3D1.1&content-type=3Dtext/plain Index: xdm.initd-5 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 # $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/files/xdm.initd-5= ,v 1.1 2011/11/24 13:09:40 chithanh Exp $ # This is here to serve as a note to myself, and future developers. # # Any Display manager (gdm,kdm,xdm) has the following problem: if # it is started before any getty, and no vt is specified, it will # usually run on vt2. When the getty on vt2 then starts, and the # DM is already started, the getty will take control of the keyboard, # leaving us with a "dead" keyboard. # # Resolution: add the following line to /etc/inittab # # x:a:once:/etc/X11/startDM.sh # # and have /etc/X11/startDM.sh start the DM in daemon mode if # a lock is present (with the info of what DM should be started), # else just fall through. # # How this basically works, is the "a" runlevel is a additional # runlevel that you can use to fork processes with init, but the # runlevel never gets changed to this runlevel. Along with the "a" # runlevel, the "once" key word means that startDM.sh will only be # run when we specify it to run, thus eliminating respawning # startDM.sh when "xdm" is not added to the default runlevel, as was # done previously. # # This script then just calls "telinit a", and init will run # /etc/X11/startDM.sh after the current runlevel completes (this # script should only be added to the actual runlevel the user is # using). # # Martin Schlemmer # aka Azarah # 04 March 2002 depend() { need localmount xdm-setup # this should start as early as possible # we can't do 'before *' as that breaks it # (#139824) Start after ypbind and autofs for network authentication # (#145219 #180163) Could use lirc mouse as input device # (#70689 comment #92) Start after consolefont to avoid display corrupti= on # (#291269) Start after quota, since some dm need readable home # (#390609) gdm-3 will fail when dbus is not running after bootmisc consolefont modules netmount after readahead-list ypbind autofs openvpn gpm lircmd after quota before alsasound # Start before X use consolekit dbus xfs } setup_dm() { local MY_XDM =09 MY_XDM=3D$(echo "${DISPLAYMANAGER}" | tr '[:upper:]' '[:lower:]') # Load our root path from profile.env # Needed for kdm PATH=3D${PATH}:$(. /etc/profile.env; echo "${ROOTPATH}") NAME=3D case "${MY_XDM}" in kdm|kde) EXE=3D"$(which kdm)" PIDFILE=3D/var/run/kdm.pid ;; kdm-*) EXE=3D"/usr/kde/${MY_XDM#kdm-}/bin/kdm" PIDFILE=3D/var/run/kdm.pid ;; entrance*) EXE=3D/usr/sbin/entranced PIDFILE=3D/var/lib/entranced.pid ;; gdm|gnome) EXE=3D/usr/bin/gdm [ "${RC_UNAME}" !=3D "Linux" ] && NAME=3Dgdm-binary PIDFILE=3D/var/run/gdm.pid ;; wdm) EXE=3D/usr/bin/wdm PIDFILE=3D ;; gpe) EXE=3D/usr/bin/gpe-dm PIDFILE=3D/var/run/gpe-dm.pid ;; lxdm) EXE=3D/usr/sbin/lxdm-binary PIDFILE=3D/var/run/lxdm.pid START_STOP_ARGS=3D"--background" ;; lightdm) EXE=3D/usr/sbin/lightdm PIDFILE=3D/var/run/lightdm.pid START_STOP_ARGS=3D"--background" ;; *) # first find out if there is such executable EXE=3D"$(which ${MY_XDM} 2>/dev/null)" PIDFILE=3D"/var/run/${MY_XDM}.pid" # warn user that he is doing sick things if the exe was not found if [ -z "${EXE}" ]; then echo "ERROR: Your XDM value is invalid." echo " No ${MY_XDM} executable could be found on your system." fi ;; esac if ! [ -x "${EXE}" ]; then EXE=3D/usr/bin/xdm PIDFILE=3D/var/run/xdm.pid if ! [ -x "/usr/bin/xdm" ]; then echo "ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xd= m," echo " or install x11-apps/xdm package" eend 255 fi fi } # Check to see if something is defined on our VT vtstatic() { if [ -e /etc/inittab ] ; then grep -Eq "^[^#]+.*\" /etc/inittab elif [ -e /etc/ttys ] ; then grep -q "^ttyv$(($1 - 1))" /etc/ttys else return 1 fi } start() { local EXE NAME PIDFILE setup_dm if [ -f /etc/.noxdm ]; then einfo "Skipping ${EXE##*/}, /etc/.noxdm found or \"nox\" bootparam pass= ed." rm /etc/.noxdm return 0 fi ebegin "Setting up ${EXE##*/}" # save the prefered DM save_options "service" "${EXE}" save_options "name" "${NAME}" save_options "pidfile" "${PIDFILE}" save_options "start_stop_args" "${START_STOP_ARGS}" if [ -n "${CHECKVT-y}" ] ; then if vtstatic "${CHECKVT:-7}" ; then if [ -x /sbin/telinit ] && [ "${SOFTLEVEL}" !=3D "BOOT" ] && [ "${RC_S= OFTLEVEL}" !=3D "BOOT" ]; then ewarn "Something is already defined on VT ${CHECKVT:-7}, will start X= later" telinit a >/dev/null 2>&1 return 0 else eerror "Something is already defined on VT ${CHECKVT:-7}, not startin= g" return 1 fi fi fi /etc/X11/startDM.sh eend 0 } stop() { local curvt retval retval=3D0 if [ -t 0 ]; then if type fgconsole >/dev/null 2>&1; then curvt=3D$(fgconsole 2>/dev/null) else curvt=3D$(tty) case "${curvt}" in /dev/ttyv[0-9]*) curvt=3D${curvt#/dev/ttyv} ;; *) curvt=3D ;; esac fi fi local myexe myname mypidfile myservice myexe=3D$(get_options "service") myname=3D$(get_options "name") mypidfile=3D$(get_options "pidfile") myservice=3D${myexe##*/} [ -z "${myexe}" ] && return 0 ebegin "Stopping ${myservice}" if start-stop-daemon --quiet --test --stop --exec "${myexe}"; then start-stop-daemon --stop --exec "${myexe}" --retry TERM/5/TERM/5 \ ${mypidfile:+--pidfile} ${mypidfile} \ ${myname:+--name} ${myname} retval=3D${?} fi # switch back to original vt if [ -n "${curvt}" ]; then if type chvt >/dev/null 2>&1; then chvt "${curvt}" else vidcontrol -s "$((curvt + 1))" fi fi eend ${retval} "Error stopping ${myservice}" return ${retval} } # vim: set ts=3D4 :