Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Sympa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
docker
Sympa
Commits
5b18b90c
Verified
Commit
5b18b90c
authored
2 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Stop properly sympa container on program failure
parent
df42f887
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker/sympa/Dockerfile
+4
-0
4 additions, 0 deletions
docker/sympa/Dockerfile
docker/sympa/exit-event-listener.py
+19
-0
19 additions, 0 deletions
docker/sympa/exit-event-listener.py
docker/sympa/supervisord.conf
+4
-0
4 additions, 0 deletions
docker/sympa/supervisord.conf
with
27 additions
and
0 deletions
docker/sympa/Dockerfile
+
4
−
0
View file @
5b18b90c
...
@@ -49,4 +49,8 @@ ENV LANGUAGE en_US:en
...
@@ -49,4 +49,8 @@ ENV LANGUAGE en_US:en
ENV
LC_ALL en_US.UTF-8
ENV
LC_ALL en_US.UTF-8
COPY
exit-event-listener.py /usr/local/bin
RUN
chmod
+x /usr/local/bin/exit-event-listener.py
ENTRYPOINT
/entrypoint
ENTRYPOINT
/entrypoint
This diff is collapsed.
Click to expand it.
docker/sympa/exit-event-listener.py
0 → 100644
+
19
−
0
View file @
5b18b90c
#!/usr/bin/env python3
# From https://stackoverflow.com/a/37527488
import
os
import
signal
from
supervisor
import
childutils
def
main
():
while
True
:
headers
,
payload
=
childutils
.
listener
.
wait
()
childutils
.
listener
.
ok
()
if
headers
[
'
eventname
'
]
!=
'
PROCESS_STATE_FATAL
'
:
continue
os
.
kill
(
os
.
getppid
(),
signal
.
SIGTERM
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
docker/sympa/supervisord.conf
+
4
−
0
View file @
5b18b90c
...
@@ -126,3 +126,7 @@ stdout_logfile_maxbytes=0
...
@@ -126,3 +126,7 @@ stdout_logfile_maxbytes=0
stderr_logfile_maxbytes
=
0
stderr_logfile_maxbytes
=
0
stdout_logfile
=/
dev
/
stdout
stdout_logfile
=/
dev
/
stdout
stderr_logfile
=/
dev
/
stderr
stderr_logfile
=/
dev
/
stderr
[
eventlistener
:
exit_on_any_fatal
]
events
=
PROCESS_STATE_FATAL
command
=
exit
-
event
-
listener
.
py
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment