Skip to content

Commit

Permalink
use tempdir for graceful terminator socket when env not set
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinschmidt committed Aug 7, 2024
1 parent 973acac commit bc3734c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/graceful_termination.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ _deputy_ipc_dir() = get(tempdir, ENV, "DEPUTY_IPC_DIR")

# Prefer using UNIX domain sockets but if the `DEPUTY_IPC_DIR` is set assume the file
# system is read-only and use a named pipe instead.
function _graceful_terminator_socket_path(pid::Int32)
name = "graceful-terminator.$pid"
return haskey(ENV, "DEPUTY_IPC_DIR") ? joinpath(_deputy_ipc_dir(), name) : name
function _graceful_terminator_socket_path(pid::Int32) =
return joinpath(_deputy_ipc_dir(), "graceful-terminator.$pid")
end

# Following the Linux convention for pid files:
Expand Down

0 comments on commit bc3734c

Please sign in to comment.