bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 398 forks source link

Unable to create PID file #582

Closed dmytronasyrov closed 5 years ago

dmytronasyrov commented 5 years ago
  1. set erl_opts: "-kernel pidfile \'etc/server.pid\'" in config.exs - doesn't work
  2. -kernel pidfile "'etc/server.pid'" in vm.args - doesn't work
  3. env variable PIDFILE=etc/server.pid - this works
{"could not start kernel pid",'Elixir.Mix.Releases.Runtime.Pidfile',{error {invalid_pidfile_config,'etc/server.pid'}}}
could not start kernel pid (Elixir.Mix.Releases.Runtime.Pidfile) ({error {invalid_pidfile_config,etc/server.pid}})

Trying to create PID file with kernel config but works only with env variable. Have tried different combinations of single and double quotes, but no luck. Any ideas or maybe a working snippet with a pidfile from vm.args or erl_opts? Thank you.

olgad0110 commented 5 years ago

I have similar issue with the PID file configuration - the one in vm.args file gave me the same error. I looked around in the code and manage to find that in that particular case, when the provided value has the format of -kernel pidfile '"etc/server.pid"' (notice the different order of ' and "), the path variable in the code is a list and in the code the pid file is only initiated if the path variable is a binary. I opened a PR https://github.com/bitwalker/distillery/pull/600 with a fix for this, feel free to test if this works for you.

dmytronasyrov commented 5 years ago

@ardhena yes, it works with your fix! @bitwalker should accept your PR. Thank you