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 8c8ee98 commit af378aa
Show file tree
Hide file tree
Showing 2 changed files with 18 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
17 changes: 16 additions & 1 deletion docker/terrat/service/terrat
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,22 @@ 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',
'-t',
'-s',
'100',
'-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 af378aa

Please sign in to comment.