Properly initialize runtime directory

This commit is contained in:
Patrick Lühne 2020-05-26 04:36:15 +02:00
parent b68bc7ddb5
commit 48c35aab63
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
2 changed files with 4 additions and 6 deletions

View File

@ -25,13 +25,9 @@ $original_stdin = $stdin.dup
$original_stdout = $stdout.dup
$original_stderr = $stderr.dup
$run_base_path = "/run/github-fast-env"
$runtime_directory = "/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"
control_socket_path = "#{$runtime_directory}/github-fast-envd.sock"
if File.exist?(control_socket_path) and File.socket?(control_socket_path)
File.unlink(control_socket_path)

View File

@ -4,6 +4,8 @@ After=github-enterprise.target
Wants=github-enterprise.target
[Service]
RuntimeDirectory=github-fast-env
RuntimeDirectoryMode=0700
Type=simple
ExecStart=/data/github/current/bin/safe-ruby /usr/bin/github-fast-envd