From 857e53cf30d17a1fe87b683bb26a54899760dcd8 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Fri, 9 Jul 2021 09:39:44 +0200 Subject: various improvements to logging and performance added service timeout (180s), improved debug logging, moved persistence checking havocs into single noise by selecting randomly which type of stl to upload (still check correctness of parsing of any type in havocs) --- service/entrypoint.sh | 2 +- service/src/main.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'service') diff --git a/service/entrypoint.sh b/service/entrypoint.sh index 8b6f3e0..61b85e6 100755 --- a/service/entrypoint.sh +++ b/service/entrypoint.sh @@ -12,5 +12,5 @@ while [ 1 ]; do done & CMD="ncat --keep-open --listen -p 9000 --max-conns 4000 \ ---no-shutdown --wait 10s --idle-timeout 180s --exec /service/build/stldoctor" +--no-shutdown --wait 10s --exec /service/build/stldoctor" su -s /bin/sh -c "$CMD" service diff --git a/service/src/main.c b/service/src/main.c index dd8bca9..c571df9 100644 --- a/service/src/main.c +++ b/service/src/main.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -454,6 +455,12 @@ cleanexit() free(resultdir); } +void +timeout() +{ + die("time's up!\n"); +} + int main() { @@ -461,6 +468,9 @@ main() int exit, i, cmdlen; char *cp, *arg; + signal(SIGALRM, timeout); + alarm(3); + if (!(envstr = getenv("RESULTDIR"))) die("RESULTDIR not defined\n"); -- cgit v1.2.3-71-gd317