Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use a better way to safely launch a program in the background.

  • Loading branch information...
commit d61d3ad3fbcc76ea1ba71a12632193fe5396a26f 1 parent a80d9cb
@CasperVector authored
Showing with 3 additions and 13 deletions.
  1. +2 −5 src/cdm
  2. +1 −8 src/cdmrc
View
7 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.
View
9 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"
+
Please sign in to comment.
Something went wrong with that request. Please try again.