Skip to content

Commit

Permalink
#324 #325 #317 ADD strace debugging to startup
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitz committed Feb 26, 2025
1 parent 8ce12e7 commit 20e2205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docker/terrat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ RUN apk add --no-cache \
py3-yaml \
python3 \
runit \
strace \
yj
RUN mkdir -p /usr/local/bin /etc/service/terrat /etc/service/nginx /usr/local/share/terrat/ui/assets
COPY docker/terrat/service/terrat /etc/service/terrat/run
Expand Down Expand Up @@ -161,6 +162,7 @@ RUN apk add --no-cache \
py3-yaml \
python3 \
runit \
strace \
yj
RUN mkdir -p /usr/local/bin /etc/service/terrat /etc/service/nginx /usr/local/share/terrat/ui/assets
COPY docker/terrat/service/terrat /etc/service/terrat/run
Expand Down
5 changes: 4 additions & 1 deletion docker/terrat/service/terrat
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def main():
subprocess.check_call(['/usr/local/bin/terrat', 'migrate', '--verbosity=debug'])

# Run server
os.execv('/usr/local/bin/terrat', ['/usr/local/bin/terrat', 'server', '--verbosity=debug'])
if os.environ.get('TERRAT_STRACE'):
os.execv('/usr/bin/strace', ['/usr/bin/strace', '-ff', '-o', '/tmp/strace.log', '-v', '/usr/local/bin/terrat', 'server', '--verbosity=debug'])
else:
os.execv('/usr/local/bin/terrat', ['/usr/local/bin/terrat', 'server', '--verbosity=debug'])


if __name__ == '__main__':
Expand Down

0 comments on commit 20e2205

Please sign in to comment.