{"action":"created","issue":{"url":"https://api.github.com/repos/pimatic/pimatic/issues/667","labels_url":"https://api.github.com/repos/pimatic/pimatic/issues/667/labels{/name}","comments_url":"https://api.github.com/repos/pimatic/pimatic/issues/667/comments","events_url":"https://api.github.com/repos/pimatic/pimatic/issues/667/events","html_url":"https://github.com/pimatic/pimatic/issues/667","id":83681458,"number":667,"title":"[pimatic] Could not write config file: EMFILE, too many open files","user":{"login":"georg90","id":6489464,"avatar_url":"https://avatars.githubusercontent.com/u/6489464?v=3","gravatar_id":"","url":"https://api.github.com/users/georg90","html_url":"https://github.com/georg90","followers_url":"https://api.github.com/users/georg90/followers","following_url":"https://api.github.com/users/georg90/following{/other_user}","gists_url":"https://api.github.com/users/georg90/gists{/gist_id}","starred_url":"https://api.github.com/users/georg90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georg90/subscriptions","organizations_url":"https://api.github.com/users/georg90/orgs","repos_url":"https://api.github.com/users/georg90/repos","events_url":"https://api.github.com/users/georg90/events{/privacy}","received_events_url":"https://api.github.com/users/georg90/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-01T20:35:35Z","updated_at":"2015-06-04T16:40:49Z","closed_at":null,"body":"Happens quite often when I use this rule:\r\n```if every 10 minutes then execute \"sudo hping3 -2 -c 3 -p 5353 192.168.0.105 >/dev/null 2>&1 || true\"```\r\n\r\nI get this error:\r\n```\r\nerror [pimatic]: Error on evaluation of rule condition of rule ping-iphone-to-be-awake: spawn EMFILE\r\n22:20:00error [pimatic]: rule ping-iphone-to-be-awake error executing an action: spawn EMFILE\r\n```\r\n\r\nafter a while pimatic will freeze with the above error (too many open files)\r\n\r\nmy file limit is\r\n```\r\nkodi@zbox:~$ ulimit -n\r\n1024\r\n```"},"comment":{"url":"https://api.github.com/repos/pimatic/pimatic/issues/comments/108962816","html_url":"https://github.com/pimatic/pimatic/issues/667#issuecomment-108962816","issue_url":"https://api.github.com/repos/pimatic/pimatic/issues/667","id":108962816,"user":{"login":"mwittig","id":6117742,"avatar_url":"https://avatars.githubusercontent.com/u/6117742?v=3","gravatar_id":"","url":"https://api.github.com/users/mwittig","html_url":"https://github.com/mwittig","followers_url":"https://api.github.com/users/mwittig/followers","following_url":"https://api.github.com/users/mwittig/following{/other_user}","gists_url":"https://api.github.com/users/mwittig/gists{/gist_id}","starred_url":"https://api.github.com/users/mwittig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwittig/subscriptions","organizations_url":"https://api.github.com/users/mwittig/orgs","repos_url":"https://api.github.com/users/mwittig/repos","events_url":"https://api.github.com/users/mwittig/events{/privacy}","received_events_url":"https://api.github.com/users/mwittig/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T16:40:49Z","updated_at":"2015-06-04T16:40:49Z","body":"The browser may keep connections open for a long time. However, it is strange that you have so many connections!!! Possibly, the connections are stale/dead? This may happen, for example, if you use a VPN between your workplace computer and pimatic and the VPN gets torn down at some point. It may also happen a firewall in between will drop (-> forget) the connection after a certain period of inactivity.\r\n\r\n@sweetpi Assuming \"zbox.fritz.box:1443\" is the pimatic web frontend, may be pimatic should detect & close \"idle\" connections somehow?! It should be possible to use TCP-Keepalives to detect dead connections. See \"Checking for dead peers\" at http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html Another strategy may be to implement an application-level timer for accepted connections as TCP-Keepalice has some drawbacks."}}