Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
4b2e2228
Commit
4b2e2228
authored
Feb 13, 2018
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sigtrap: Ensure cleanup actions happen before too many things go wrong
parent
f26447e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
sigtrap_posix.go
sigtrap_posix.go
+3
-3
No files found.
sigtrap_posix.go
View file @
4b2e2228
...
@@ -41,14 +41,14 @@ func trapSignalsPosix() {
...
@@ -41,14 +41,14 @@ func trapSignalsPosix() {
case
syscall
.
SIGTERM
:
case
syscall
.
SIGTERM
:
log
.
Println
(
"[INFO] SIGTERM: Shutting down servers then terminating"
)
log
.
Println
(
"[INFO] SIGTERM: Shutting down servers then terminating"
)
exitCode
:=
executeShutdownCallbacks
(
"SIGTERM"
)
exitCode
:=
executeShutdownCallbacks
(
"SIGTERM"
)
for
_
,
f
:=
range
OnProcessExit
{
f
()
// only perform important cleanup actions
}
err
:=
Stop
()
err
:=
Stop
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"[ERROR] SIGTERM stop: %v"
,
err
)
log
.
Printf
(
"[ERROR] SIGTERM stop: %v"
,
err
)
exitCode
=
3
exitCode
=
3
}
}
for
_
,
f
:=
range
OnProcessExit
{
f
()
// only perform important cleanup actions
}
os
.
Exit
(
exitCode
)
os
.
Exit
(
exitCode
)
case
syscall
.
SIGUSR1
:
case
syscall
.
SIGUSR1
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment