Create socket and pipes in /run
This commit is contained in:
parent
e1b0d7b0eb
commit
64278b6573
@ -33,7 +33,7 @@ end
|
||||
# TODO: support arguments
|
||||
script_path = File.realpath(ARGV[0])
|
||||
|
||||
control_socket_path = "/tmp/github-fast-envd.sock"
|
||||
control_socket_path = "/run/github-fast-env/github-fast-envd.sock"
|
||||
|
||||
$original_stdin = $stdin.dup
|
||||
$original_stdout = $stdout.dup
|
||||
|
@ -29,7 +29,13 @@ $original_stdin = $stdin.dup
|
||||
$original_stdout = $stdout.dup
|
||||
$original_stderr = $stderr.dup
|
||||
|
||||
control_socket_path = "/tmp/github-fast-envd.sock"
|
||||
$run_base_path = "/run/github-fast-env"
|
||||
|
||||
unless File.directory?($run_base_path)
|
||||
FileUtils.mkdir_p($run_base_path, :mode => 0700)
|
||||
end
|
||||
|
||||
control_socket_path = "#{$run_base_path}/github-fast-envd.sock"
|
||||
|
||||
if File.exist?(control_socket_path) and File.socket?(control_socket_path)
|
||||
File.unlink(control_socket_path)
|
||||
@ -87,7 +93,7 @@ def read_command(control_socket)
|
||||
end
|
||||
|
||||
def set_up_named_pipes(control_socket, connection_id)
|
||||
pipe_base_path = "/tmp/github-fast-envd.#{connection_id}"
|
||||
pipe_base_path = "/#{$run_base_path}/github-fast-envd.#{connection_id}"
|
||||
pipe_base_path_encoded = Base64.encode64(pipe_base_path).delete("\n")
|
||||
|
||||
stdin = open_pipe("#{pipe_base_path}.stdin")
|
||||
|
Loading…
Reference in New Issue
Block a user