Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/resty/auto-ssl/jobs/renewal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ local function do_renew(auto_ssl_instance)
if not get_interval_lock("renew", auto_ssl_instance:get("renew_check_interval")) then
return
end
local renew_lock, new_renew_lock_err = lock:new("auto_ssl", { exptime = 1800, timeout = 0 })
local renew_lock, new_renew_lock_err = lock:new("auto_ssl_settings", { exptime = 1800, timeout = 0 })
if new_renew_lock_err then
ngx.log(ngx.ERR, "auto-ssl: failed to create lock: ", new_renew_lock_err)
return
Expand Down
1 change: 1 addition & 0 deletions lib/resty/auto-ssl/utils/shell_execute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ return function(command)
wait_time = wait_time + sleep_time

if wait_time > max_time then
ngx.log(ngx.ERR, "auto-ssl: sockproc did not start in expected amount of time")
break
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/resty/auto-ssl/utils/start_sockproc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ local auto_ssl = require "resty.auto-ssl"
local lock = require "resty.lock"

local function start()
local _, set_false_err = ngx.shared.auto_ssl_settings:safe_set("sockproc_started", false)
if set_false_err then
ngx.log(ngx.ERR, "auto-ssl: failed to set shdict for sockproc_started: ", set_false_err)
end

ngx.log(ngx.NOTICE, "auto-ssl: starting sockproc")

local exit_status = os.execute("umask 0022 && " .. auto_ssl.lua_root .. "/bin/resty-auto-ssl/start_sockproc")
-- Lua 5.2+ returns boolean. Prior versions return status code.
if exit_status == 0 or exit_status == true then
Expand All @@ -21,7 +27,7 @@ return function(force)
end

-- Add lock to ensure only a single start command is attempted at a time.
local start_lock, new_lock_err = lock:new("auto_ssl", { exptime = 600, timeout = 0 })
local start_lock, new_lock_err = lock:new("auto_ssl_settings", { exptime = 600, timeout = 0 })
if new_lock_err then
ngx.log(ngx.ERR, "Failed to create lock: ", new_lock_err)
return
Expand Down