summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-04-05 15:30:19 +0000
committerRoy Marples <uberlord@gentoo.org>2007-04-05 15:30:19 +0000
commit02919b7028d26d70b5b9ab63e3537f8df806743c (patch)
tree3a4d95b3a175ba0829cebc6a2610f1e2509d7283 /x11-apps
parentDepend on >=media-gfx/enblend-2.4 if the enblend flag is set for bug 173418. ... (diff)
downloadgentoo-2-02919b7028d26d70b5b9ab63e3537f8df806743c.tar.gz
gentoo-2-02919b7028d26d70b5b9ab63e3537f8df806743c.tar.bz2
gentoo-2-02919b7028d26d70b5b9ab63e3537f8df806743c.zip
Fix the init script a little for FreeBSD again.
(Portage version: 2.1.2.3)
Diffstat (limited to 'x11-apps')
-rw-r--r--x11-apps/xinit/ChangeLog6
-rw-r--r--x11-apps/xinit/files/startDM.sh6
-rwxr-xr-xx11-apps/xinit/files/xdm.initd90
3 files changed, 48 insertions, 54 deletions
diff --git a/x11-apps/xinit/ChangeLog b/x11-apps/xinit/ChangeLog
index eb4c6832cde5..9a5d80afbabe 100644
--- a/x11-apps/xinit/ChangeLog
+++ b/x11-apps/xinit/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for x11-apps/xinit
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/ChangeLog,v 1.78 2007/04/03 16:41:03 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/ChangeLog,v 1.79 2007/04/05 15:30:19 uberlord Exp $
+
+ 05 Apr 2007; Roy Marples <uberlord@gentoo.org> files/startDM.sh,
+ files/xdm.initd:
+ Fix the init script a little for FreeBSD again.
*xinit-1.0.3-r2 (03 Apr 2007)
diff --git a/x11-apps/xinit/files/startDM.sh b/x11-apps/xinit/files/startDM.sh
index d2132348372d..9775b07ff7a5 100644
--- a/x11-apps/xinit/files/startDM.sh
+++ b/x11-apps/xinit/files/startDM.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2
-# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/startDM.sh,v 1.3 2007/03/11 02:01:24 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/startDM.sh,v 1.4 2007/04/05 15:30:19 uberlord Exp $
# We need to source /etc/profile for stuff like $LANG to work
# bug #10190.
@@ -21,8 +21,10 @@ export GDK_USE_XFT=1
export SVCNAME=xdm
EXEC="$(get_options service)"
NAME="$(get_options name)"
+PIDFILE="$(get_options pidfile)"
-start-stop-daemon --start --exec ${EXEC} ${NAME:+--name }${NAME} || \
+start-stop-daemon --start --exec ${EXEC} \
+${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} || \
eerror "ERROR: could not start the Display Manager"
# vim:ts=4
diff --git a/x11-apps/xinit/files/xdm.initd b/x11-apps/xinit/files/xdm.initd
index a285b77303c1..8f2d2db11289 100755
--- a/x11-apps/xinit/files/xdm.initd
+++ b/x11-apps/xinit/files/xdm.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2
-# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/xdm.initd,v 1.2 2007/04/03 16:41:03 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/xdm.initd,v 1.3 2007/04/05 15:30:19 uberlord Exp $
# This is here to serve as a note to myself, and future developers.
#
@@ -50,23 +50,29 @@ depend() {
before alsasound
# Start before X
- use acpid hald xfs consolekit
+ use acpid consolekit hald xfs
}
setup_dm() {
- source /etc/profile.env
- export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
+ local MY_XDM="$(echo "${DISPLAYMANAGER}" | tr '[:upper:]' '[:lower:]')"
+
+ # Load our root path from profile.env
+ # Needed for kdm
+ PATH="${PATH}:$(. /etc/profile.env; echo "${ROOTPATH}")"
- local MY_XDM="$(echo ${DISPLAYMANAGER} | tr '[:upper:]' '[:lower:]')"
case "${MY_XDM}" in
kdm|kde|kde2|kde3)
EXE="$(which kdm)"
+ PIDFILE=/var/run/kdm.pid
;;
entrance*)
- EXE="$(which entranced)"
+ EXE=/usr/sbin/enranced
+ PIDFILE=/var/lib/entranced.pid
;;
gdm|gnome)
EXE=/usr/bin/gdm
+ [ "${RC_UNAME}" != "Linux" ] && NAME=gdm-binary
+ PIDFILE=/var/run/gdm.pid
;;
wdm)
EXE=/usr/bin/wdm
@@ -80,55 +86,41 @@ setup_dm() {
;;
esac
- test ! -x "${EXE}" && EXE=/usr/bin/xdm
+ [ -x "${EXE}" ] || EXE=/usr/bin/xdm
}
cmdline_opt() {
- if [[ "$#" -ne 1 || ! -e /proc/cmdline ]]; then
+ if [ $# -ne 1 -o ! -r /proc/cmdline ]; then
return 1
fi
- for opt in $(</proc/cmdline); do
- case ${opt} in
- ${1}) eval ${1}="true" ;;
- esac
+ for opt in $(cat /proc/cmdline) ; do
+ [ "${opt}" = "${1}" ] && return 0
done
}
-nox() {
- # Don't start X if we were passed 'nox' at boot (#83680)
- cmdline_opt nox
-
- if [[ "$?" -ne 0 ]]; then
- return 1
- fi
-
- if [[ -n "${nox}" ]]; then
- return 0
- else
- return 1
- fi
-}
-
start() {
+ local EXE= NAME= PIDFILE=
setup_dm
- if nox; then
+ if cmdline_opt nox ; then
einfo "Skipping ${EXE}, received 'nox'"
else
ebegin "Setting up ${EXE##*/}"
#save the prefered DM
save_options "service" "${EXE}"
+ save_options "name" "${NAME}"
+ save_options "pidfile" "${PIDFILE}"
# Start as soon as possible if XSTATICVT is set
# or if we don't have telinit (as on BSD)
- if [ "${XSTATICVT}" = "yes" ] || [ ! -x /sbin/telinit ] ; then
+ if [ "${XSTATICVT}" = "yes" -o ! -x /sbin/telinit ] ; then
/etc/X11/startDM.sh
else
#tell init to run /etc/X11/startDM.sh after current
#runlevel is finished (should *not* be in the "boot"
# runlevel).
- /sbin/telinit a &>/dev/null
+ /sbin/telinit a >/dev/null 2>/dev/null
fi
eend 0
fi
@@ -138,40 +130,37 @@ start() {
stop() {
local retval=0
local curvt=
- if [ -t 0 ]
- then
- if [ -n $(type -p fgconsole) ]
- then
+ if [ -t 0 ] ; then
+ if type fgconsole >/dev/null 2>/dev/null ; then
curvt="$(fgconsole 2>/dev/null)"
else
curvt="$(tty)"
- if [ "${curvt}" == /dev/ttyv[0-9]* ]
- then
- curvt="${curvt#/dev/ttyv*}"
- else
- curvt=
- fi
+ case "${curvt}" in
+ /dev/ttyv[0-9]*) curvt="${curvt#/dev/ttyv*}" ;;
+ *) curvt= ;;
+ esac
fi
fi
local myexe="$(get_options "service")"
- local myservice="${myexe##*/}"
+ local myname="$(get_options "name")"
+ local mypidfile="$(get_options "pidfile")"
+ local myservice=${myexe##*/}
ebegin "Stopping ${myservice}"
- if start-stop-daemon --quiet --test --stop --exec "${myexe}" >/dev/null
- then
- start-stop-daemon --quiet --stop --exec "${myexe}" --retry TERM/5/TERM/5
+ 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=$?
fi
#switch back to original vt
- if [ -n "${curvt}" ]
- then
- if [ -n $(type -p chvt) ]
- then
- chvt "${curvt}" &>/dev/null
+ if [ -n "${curvt}" ] ; then
+ if type chvt >/dev/null 2>/dev/null ; then
+ chvt "${curvt}"
else
- vidcontrol -s "${curvt}"
+ vidcontrol -s "$((${curvt} + 1))"
fi
fi
eend ${retval} "Error stopping ${myservice}"
@@ -179,5 +168,4 @@ stop() {
return ${retval}
}
-
# vim:ts=4