aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
aienos.com / scripts / allen / science / allen-science-fg
| 1 | #!/bin/sh |
| 2 | # Interim foreground launcher for allen-science, run as `sudo -n` by spark-supervisor until |
| 3 | # aien-supervise owns it (allen-science.svc). No systemd unit. Same privilege drop as |
| 4 | # cortex-visitors-fg; it writes nothing: output goes to the supervisor. |
| 5 | # Install: root:root 0755 at /usr/local/libexec/aien-supervise/allen-science-fg. |
| 6 | # NOT ACTIVE here: the aggregate memory, task and CPU limits in allen-science.svc. Under this |
| 7 | # interim launcher only the per-process rlimits (prlimit in science_sandbox.py) and the service's |
| 8 | # concurrency slots bound resources; the cgroup limits apply once aien-supervise runs the service. |
| 9 | set -eu |
| 10 | umask 077 |
| 11 | exec </dev/null |
| 12 | if ss -ltnH 'sport = :18113' | grep -q .; then echo "allen-science-fg: port 18113 already in use" >&2; exit 1; fi |
| 13 | exec /usr/bin/setpriv --reuid=allen-science --regid=allen-science --clear-groups \ |
| 14 | --no-new-privs --inh-caps=-all --bounding-set=-all \ |
| 15 | /usr/bin/env -i PATH=/usr/bin:/bin \ |
| 16 | /usr/bin/python3.12 -I /opt/allen-science/launch.py --listen 127.0.0.1:18113 |