[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 1/6] ts-syslog-server: --no-stdin option



Useful when running on a tty interactively.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 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 $!;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.