[Chinese-commits] [fqterm] 18/34: use setsid(1) to run fqterm.bin

Boyuan Yang hosiet-guest at moszumanska.debian.org
Tue Nov 1 06:06:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

hosiet-guest pushed a commit to branch master
in repository fqterm.

commit 978ef23c4e979184920f2e36d9c8fb684784c2fa
Author: Iru Cai <mytbk920423 at gmail.com>
Date:   Wed Aug 17 12:59:01 2016 +0800

    use setsid(1) to run fqterm.bin
    
    After this change, ssh(1) will not require a terminal
    and always use $SSH_ASKPASS to get password.
---
 res/fqterm.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/res/fqterm.sh b/res/fqterm.sh
index d9e1d2c..2791128 100644
--- a/res/fqterm.sh
+++ b/res/fqterm.sh
@@ -21,8 +21,14 @@ if [ -x "$base_name".bin ]; then
   cd "$current_directory"
   export FQTERM_PREFIX=`dirname "$bin_directory"`
   export FQTERM_RESOURCE="$FQTERM_PREFIX/share/FQTerm"
-  "$bin_directory/$base_name.bin" "$@"
-  exit $?
+  # use setsid to run it so that programs such as
+  # ssh(1) does not have a terminal
+  if type setsid >/dev/null 2>/dev/null; then
+    SETSID="setsid -w"
+  else
+    SETSID=""
+  fi
+  exec $SETSID "$bin_directory/$base_name.bin" "$@"
 else
   cd "$current_directory"
   echo "Error, cannot find $base_name."

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/chinese/fqterm.git



More information about the Chinese-commits mailing list