X2Go Bug report logs - #300
Allow x2gothinclientcreate to run non-interactive

version graph

Package: x2gothinclient; Maintainer for x2gothinclient is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2gothinclient is src:x2gothinclient.

Reported by: Arnold Krille <a.krille@b-c-s.de>

Date: Thu, 5 Sep 2013 09:03:01 UTC

Severity: normal

Tags: pending

Found in version 1.1.0.0

Fixed in version 1.1.0.1

Done: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

Received: (at submit) by bugs.x2go.org; 5 Sep 2013 08:51:11 +0000
From a.krille@b-c-s.de  Thu Sep  5 10:51:10 2013
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,
	URIBL_BLOCKED autolearn=ham version=3.3.2
Received: from mail.b-c-s.net (mail.b-c-s.net [178.63.255.106])
	by ymir (Postfix) with ESMTP id CFF135DB17
	for <submit@bugs.x2go.org>; Thu,  5 Sep 2013 10:51:10 +0200 (CEST)
Received: from bcs01.dyn.b-c-s.net (unknown [212.255.36.182])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "bcs01.dyn.b-c-s.net", Issuer "BCS Server CA" (verified OK))
	by mail.b-c-s.net (Postfix) with ESMTPS id A9E6621BF;
	Thu,  5 Sep 2013 10:51:10 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by bcs01.dyn.b-c-s.net (Postfix) with ESMTP id 23FD62FC4CA;
	Thu,  5 Sep 2013 10:51:09 +0200 (CEST)
X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (BCS01) at bcs.bcs
Received: from bcs01.dyn.b-c-s.net ([127.0.0.1])
	by localhost (bcs01.bcs.bcs [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 4xVeSFeIK7-3; Thu,  5 Sep 2013 10:50:23 +0200 (CEST)
Received: from orinoco.bcs.bcs (dhcp153.bcs.bcs [10.110.200.153])
	by bcs01.dyn.b-c-s.net (Postfix) with ESMTP id B6DB12FC4C8;
	Thu,  5 Sep 2013 10:50:20 +0200 (CEST)
From: Arnold Krille <a.krille@b-c-s.de>
To: submit@bugs.x2go.org
Cc: Arnold Krille <a.krille@b-c-s.de>
Subject: Allow x2gothinclientcreate to run non-interactive
Date: Thu,  5 Sep 2013 10:50:18 +0200
Message-Id: <1378371018-27749-1-git-send-email-a.krille@b-c-s.de>
X-Mailer: git-send-email 1.7.9.5
Package: x2gothinclient

When you want to set up your X2Go-TCE via a script (like chef or puppet), the
installer shouldn't ask questions on the command-line. So deactivate waiting
for confirmation and make apt-get use the defaults for configuring instead of
asking.
---
 .../sbin/x2gothinclient_create                     |   24 +++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/x2gothinclientmanagement/sbin/x2gothinclient_create b/x2gothinclientmanagement/sbin/x2gothinclient_create
index 0e6037c..aae0124 100755
--- a/x2gothinclientmanagement/sbin/x2gothinclient_create
+++ b/x2gothinclientmanagement/sbin/x2gothinclient_create
@@ -43,6 +43,8 @@ TC_DEBMIRROR_URL="${TC_DEBMIRROR_URL:-'http://ftp.debian.org/debian'}"
 TC_X2GO_DEBURL="${TC_X2GO_DEBURL:-'deb http://packages.x2go.org $TC_DISTRO_CODENAME main'}"
 TC_MODULE_BLACKLIST="${TC_MODULE_BLACKLIST:-'pcspkr'}"
 
+TC_NONINTERACTIVE="${TC_NONINTERACTIVE:-}"
+
 test -e "$TC_CHROOT" && { 
 	echo "ERROR: X2Go Thin Client chroot already exists at $TC_CHROOT."
 	echo "Clear $TC_BASE/ and then run $(basename $0) again..."
@@ -54,11 +56,15 @@ test -e "$TC_CHROOT" && {
 	exit -2
 }
 
-echo "Hit <RETURN> to continue with X2Go TCE chroot creation using"
-echo "the above TCE parameters..."
-echo
-echo "Alternatively, hit STRG-C to cancel the operation now!!!"
-read
+if [ "x${TC_NONINTERACTIVE}" = "x" ]; then
+    echo "Hit <RETURN> to continue with X2Go TCE chroot creation using"
+    echo "the above TCE parameters..."
+    echo
+    echo "Alternatively, hit STRG-C to cancel the operation now!!!"
+    read
+else
+    echo "Non-interactive mode selected, will continue with the above settings"
+fi
 
 export LANG=C
 
@@ -124,6 +130,10 @@ export http_proxy=$TC_HTTP_PROXY
 export https_proxy=$TC_HTTPS_PROXY
 export ftp_proxy=$TC_FTP_PROXY
 
+if [ "x${TC_NONINTERACTIVE}" != "x" ]; then
+    export DEBIAN_FRONTEND=noninteractive
+fi
+
 mkdir -p /tmp/user/0
 mkdir -p /var/lib/xkb
 mkdir -p /var/lib/nfs
@@ -156,7 +166,9 @@ export X2GO_HANDLE_DAEMONS=false
 [ \$? -eq 0 ] && apt-get update
 [ \$? -eq 0 ] && apt-get install $TC_SHELL -y
 [ \$? -eq 0 ] && apt-get install syslinux locales -y
-[ \$? -eq 0 ] && dpkg-reconfigure locales
+if [ \$? -eq 0 -a "x${TC_NONINTERACTIVE}" != "x" ]; then
+    dpkg-reconfigure locales
+fi
 [ \$? -eq 0 ] && apt-get install linux-image-486 -y
 [ \$? -eq 0 ] && test -h /vmlinuz && mv /vmlinuz /vmlinuz.486.tmp || true
 [ \$? -eq 0 ] && LINK_TARGET=\$(readlink /vmlinuz.486.tmp | sed 's@/boot@boot@') && ln -sf \$LINK_TARGET /vmlinuz.486 && rm -f /vmlinuz.486.tmp
-- 
1.7.9.5


Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Wed Aug 5 13:25:15 2020; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.