From patchwork Tue Apr 23 12:11:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 10912853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEBA914DB for ; Tue, 23 Apr 2019 12:13:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C066C28644 for ; Tue, 23 Apr 2019 12:13:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B342D28657; Tue, 23 Apr 2019 12:13:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D2AE28644 for ; Tue, 23 Apr 2019 12:13:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hIuHF-0006Om-IR; Tue, 23 Apr 2019 12:11:57 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hIuHE-0006OW-H2 for xen-devel@lists.xenproject.org; Tue, 23 Apr 2019 12:11:56 +0000 X-Inumbo-ID: faed07e0-65c0-11e9-ac16-93d415d302d6 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id faed07e0-65c0-11e9-ac16-93d415d302d6; Tue, 23 Apr 2019 12:11:54 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,385,1549929600"; d="scan'208";a="84180812" From: Ian Jackson To: Date: Tue, 23 Apr 2019 13:11:37 +0100 Message-ID: <20190423121139.25996-2-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190423121139.25996-1-ian.jackson@eu.citrix.com> References: <20190423121139.25996-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [OSSTEST PATCH 1/3] ts-syslog-server: --no-stdin option X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Useful when running on a tty interactively. Signed-off-by: Ian Jackson --- ts-syslog-server | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ts-syslog-server b/ts-syslog-server index 1234bb7d..06a07adf 100755 --- a/ts-syslog-server +++ b/ts-syslog-server @@ -28,6 +28,13 @@ use Socket qw(PF_INET SOCK_DGRAM INADDR_ANY tsreadconfig(); +our $use_stdin = 1; + +if (@ARGV && $ARGV[0] eq '--no-stdin') { + $use_stdin = 0; + shift @ARGV; +} + die if @ARGV && $ARGV[0] =~ m/^-/; logm("starting syslog server ..."); @@ -42,7 +49,8 @@ $myaddr = inet_ntoa($myaddr); store_runvar('syslog_server',"$myaddr:$port"); -my @fhs = qw(S STDIN); +my @fhs = qw(S); +push @fhs, qw(STDIN) if $use_stdin; foreach my $fh (@fhs) { my $fl = fcntl($fh, F_GETFL, 0) // die $!;