Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure pid directory exists #11

Merged
merged 1 commit into from
Aug 6, 2024
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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "K8sDeputy"
uuid = "2481ae95-212f-4650-bb21-d53ea3caf09f"
authors = ["Beacon Biosignals, Inc"]
version = "0.1.2"
version = "0.1.3"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
6 changes: 5 additions & 1 deletion src/graceful_termination.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ end
# Following the Linux convention for pid files:
# https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html
entrypoint_pid_file() = joinpath(_deputy_ipc_dir(), "julia-entrypoint.pid")
set_entrypoint_pid(pid::Integer) = write(entrypoint_pid_file(), string(pid) * "\n")
function set_entrypoint_pid(pid::Integer)
file = entrypoint_pid_file()
mkpath(dirname(file))
return write(file, string(pid) * "\n")
end

function entrypoint_pid()
pid_file = entrypoint_pid_file()
Expand Down
Loading