nginx - Puma server receiving a connection refused because it cannot connect to the socket file -
i running jruby project puma server , nginx. run puma using puma-manager upstart service. works fine long socket file have service set use has been cleaned (deleted before trying start service). when socket file not exist, service creates , nginx can see fine. however, when stopping/starting or restarting puma, socket file remains , error: ioerror: connection refused, when trying connect socket. deleting socket resolves problem.
the problem having manually delete socket file annoying , troublesome in production.
i using puma.rb config start state_file , pidfile options set properly. thought correctly handle these files me. suggestions or on how delete socket file each time server reset?
it seems, after bit more searching, puma not have way of cleaning own socket files on shut down in instances. when moment, may add project , send them pull request. however, did find rather simple solution. in upstart conf file (they provide puma.conf , puma-manager.conf, can create own), before line runs "bundle exec puma" command have added check see if socket exists. if does, remove it. if not, move on bundle exec. seems work charm.
Comments
Post a Comment