Make alternative method of calling startx a configuration option. This changes the default startx call back to not using a subshell.

pull/22/head
polyphemus 11 years ago
parent 89473c35f3
commit 1d7c337d60

@ -77,6 +77,7 @@ xtty=${xtty:-7}
locktty=${locktty:-no}
consolekit=${consolekit:-yes}
cktimeout=${cktimeout:-30}
altstartx=${altstartx:-no}
[[ -z "${binlist[*]}" ]] && binlist=()
[[ -z "${namelist[*]}" ]] && namelist=()
[[ -z "${flaglist[*]}" ]] && flaglist=()
@ -202,6 +203,7 @@ case ${flaglist[$binindex]} in
serverargs=(":${display}" "${serverargs[@]}" "vt$vt")
$(yesno consolekit) && launchflags=(-c -t "$cktimeout")
$(yesno altstartx) && launchflags=("${launchflags[@]}" --altstartx)
if cdm-xlaunch "${launchflags[@]}" -- "${bin[@]}" -- "${serverargs[@]}"
then
exitnormal

@ -31,11 +31,12 @@
name=$(basename "$0")
consolekit=false
cktimeout=30
altstartx=false
info() { printf ' \033[01;32m*\033[00m '; echo "$name: $*"; }
error() { (printf ' \033[01;31m*\033[00m '; echo "$name: $*") > /dev/stderr; }
args=$(getopt -n "$name" -o ct: -l consolekit,timeout: -- "$@") || exit 1
args=$(getopt -n "$name" -o ct: -l consolekit,timeout,altstartx: -- "$@") || exit 1
eval set -- "$args"
for arg in "$@"
do
@ -47,6 +48,9 @@ do
shift
cktimeout=$1; shift
;;
'--altstartx')
altstartx=true; shift
;;
'--')
shift
break
@ -76,7 +80,13 @@ if $consolekit; then
dbuspid=$(<"$dbuspidfifo"); rm -f "$dbuspidfifo"
fi
$(setsid startx "$@" > /dev/null 2>&1) &
if $altstartx; then
# Alternative method of calling setsid(/startx) for systems that are unresponsive to the 'normal' call.
# This method should be avoided because this implementation keeps extra background processes, waiting for startx to return.
$(setsid startx "$@" > /dev/null 2>&1) &
else
setsid startx "$@" > /dev/null 2>&1 &
fi
# If wait(1) returns with a value >128, it was interrupted by kill(1),
# so registration was sucessful.

@ -56,3 +56,8 @@ cktimeout=30
# Arguments with whitespaces should be quoted or escaped.
serverargs=(-nolisten tcp)
# Alternative method of calling startx(/setsid). Should only be set if cdm
# does not start X as expected (bash -x shows call to setsid startx, but for
# no apparent reason does not start X).
# Only provided in the hope it proves to be useful, not a guaranteed fix.
altstartx=no

Loading…
Cancel
Save