{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/6796","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/6796/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/6796/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/6796/events","html_url":"https://github.com/facebook/hhvm/issues/6796","id":130333733,"number":6796,"title":"Multiple HHVM - 111: Connection refused","user":{"login":"ssimpo","id":6059014,"avatar_url":"https://avatars.githubusercontent.com/u/6059014?v=3","gravatar_id":"","url":"https://api.github.com/users/ssimpo","html_url":"https://github.com/ssimpo","followers_url":"https://api.github.com/users/ssimpo/followers","following_url":"https://api.github.com/users/ssimpo/following{/other_user}","gists_url":"https://api.github.com/users/ssimpo/gists{/gist_id}","starred_url":"https://api.github.com/users/ssimpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssimpo/subscriptions","organizations_url":"https://api.github.com/users/ssimpo/orgs","repos_url":"https://api.github.com/users/ssimpo/repos","events_url":"https://api.github.com/users/ssimpo/events{/privacy}","received_events_url":"https://api.github.com/users/ssimpo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-01T11:17:31Z","updated_at":"2016-02-01T11:17:31Z","closed_at":null,"body":"I am getting \"(111: Connection refused)\" when I have multiple instances of HHVM running with different user names. The errors only start after I restart one of the HHVM services.  I have tried many different arrangements but this seems to be an error with HHVM?\r\n\r\nMy setup is as follows:\r\n- Debian Jessie\r\n- Nginx (1.6.2)\r\n- HHVM (using file sockets)\r\n\r\nThe idea is that each website is running under its own user name as is the normal setup with php-fpm.  For this purpose we have a series of init.d scripts each running HHVM as a different user.  Nginx is connecting to these servers via file sockets (although we have tried normal network sockets and get the same errors).  Each server then has its' own ini file with the user set in this as well.\r\n\r\nI have checked the file permissions on just about everything I can imagine and am sure these are set correctly. Also, used setfacl to make sure both www-data and the website user both have access (just in case).\r\n\r\nBasically, on first run all is well. The services start and each website connects perfectly.  However, if we restart one of the HHVM instances it seems to knock-out all the other file sockets.\r\n\r\nEg.  Two websites:\r\n\r\n- example.org - HHVM running as example-org user and group\r\n- example.com - HHVM running as example-com user and group\r\n\r\nOn initial start the file sockets are created and the sites run perfectly.  Say you then restart the first HHVM instance (example.org) then it will restart and example.org will run perfectly.  However, the other site will now not work (111: Connection refused).  If you then try to restart the 2nd site it will then work but knock-out the first.\r\n\r\nThe only way to get all sites working after a restart is to stop all the HHVM instances, delete file sockets and then restart all again.\r\n\r\nI hope this makes sense? It is quite complicated to explain clearly. However, I guess it can easily be duplicated by anyone who tries to copy this\r\n\r\nI have been working on this for a few days so have tried multiple setups and options.  Everyone seems to lead to the the same restart issue.  It is like the other sockets are closed or changed on a restart.  I am guessing this is a bug? Since, this actually works on first-run, I feel reasonably confident that the file permissions on the sockets (...etc) are correct.\r\n\r\nIt would be possible of course to write a script, which closed all HHVM instances, deleted all file sockets and then restarted all.  However, once you have a more than a handful of sites running it would be a pain.\r\n\r\nPerhaps, this is just wrong setup? Is this even the right way to run each site securely as a different user? Obviously, the idea is to increase security. Sorry if I am wasting anyone's time."}}