From d61d3ad3fbcc76ea1ba71a12632193fe5396a26f Mon Sep 17 00:00:00 2001 From: "Casper Ti. Vector" Date: Sat, 7 Apr 2012 18:20:21 +0800 Subject: [PATCH] Use a better way to safely launch a program in the background. `$loginshell' is removed accordingly. See . --- src/cdm | 7 ++----- src/cdmrc | 9 +-------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/cdm b/src/cdm index cb3dd4f..4787f11 100755 --- a/src/cdm +++ b/src/cdm @@ -217,11 +217,8 @@ xstart() { rm -f $fifo fi - if $(yesno loginshell); then - nohup bash --login -c "startx $wm_bin -- ${serverargs}" &> /dev/null & - else - nohup startx $wm_bin -- ${serverargs} &> /dev/null & - fi + # Conform to POSIX and do not use `>&' here. + sh -i -c "(startx $wm_bin -- ${serverargs} > /dev/null 2>&1 &)" if [[ -n $clockpid ]]; then #if wait returns with a value >128, it was interrupted by the trap, so registration was sucessful. diff --git a/src/cdmrc b/src/cdmrc index 8c9259b..07a8f0e 100644 --- a/src/cdmrc +++ b/src/cdmrc @@ -47,14 +47,6 @@ xtty=7 # setting the display=N option on a per-user basis.) locktty=no -# Enable login shell (fixes issues with some keymaps, uses bash). -# Note that your bash scripts won't have any terminal as stdin when -# started in this way. This may break some commands, including stty, -# unless you explicitly check for [ -t 0 ] or that every login shell -# is also interactive. However, we're sending stdout and stderr to -# /dev/null, so you won't see the complaints. -loginshell=no - # The use of consolekit has recently become manditory with hal. However, # some users might prefer not using either one. If you don't want to # use consolekit, set the following variable to "no". @@ -75,3 +67,4 @@ usexinit=no # Additional arguments to pass to X server; it will be called as: # exec /usr/bin/X :$display $serverargs vt$((xtty+display)) serverargs="-nolisten tcp" +