-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
kong quit
for graceful shutdown
- Loading branch information
1 parent
219fa7f
commit 1580a2f
Showing
7 changed files
with
55 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env lua | ||
|
||
local constants = require "kong.constants" | ||
local cutils = require "kong.cli.utils" | ||
local signal = require "kong.cli.utils.signal" | ||
local args = require("lapp")(string.format([[ | ||
Graceful shutdown | ||
Usage: kong stop [options] | ||
Options: | ||
-c,--config (default %s) configuration file | ||
]], constants.CLI.GLOBAL_KONG_CONF)) | ||
|
||
if signal.send_signal(args.config, "quit") then | ||
cutils.logger:success("Stopped") | ||
else | ||
cutils.logger:error_exit("Could not gracefully stop Kong") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
#!/usr/bin/env lua | ||
|
||
local constants = require "kong.constants" | ||
local cutils = require "kong.cli.utils" | ||
local signal = require "kong.cli.utils.signal" | ||
local args = require("lapp")(string.format([[ | ||
Fast shutdown | ||
Usage: kong stop [options] | ||
Options: | ||
-c,--config (default %s) configuration file | ||
]], constants.CLI.GLOBAL_KONG_CONF)) | ||
|
||
signal.send_stop(args.config) | ||
-- Check if running, will exit if not | ||
signal.is_running(args.config) | ||
|
||
-- Send 'stop' signal (fast shutdown) | ||
if signal.send_signal(args.config, "stop") then | ||
cutils.logger:success("Stopped") | ||
else | ||
cutils.logger:error_exit("Could not stop Kong") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters