aboutsummaryrefslogtreecommitdiffstats
path: root/service/entrypoint.sh
blob: 8b6f3e0147032be9fcf637c2a2ca2ec0a336f63f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

mkdir -p "$RESULTDIR"
chown -R service:service "$RESULTDIR"

expiry=$((13*60))
while [ 1 ]; do
	reftime="$(($(date +%s)-$expiry))"
	echo "[FILE CLEANUP] @ $(date +%T)"
	cleaner "$RESULTDIR" "$reftime" &> /tmp/cleaner-log
	sleep 70
done &

CMD="ncat --keep-open --listen -p 9000 --max-conns 4000 \
--no-shutdown --wait 10s --idle-timeout 180s --exec /service/build/stldoctor"
su -s /bin/sh -c "$CMD" service