{"action":"created","issue":{"url":"https://api.github.com/repos/3Hren/blackhole/issues/58","labels_url":"https://api.github.com/repos/3Hren/blackhole/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/3Hren/blackhole/issues/58/comments","events_url":"https://api.github.com/repos/3Hren/blackhole/issues/58/events","html_url":"https://github.com/3Hren/blackhole/issues/58","id":97575652,"number":58,"title":"files sink doesn't always rotate logs","user":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-27T23:02:43Z","updated_at":"2015-07-29T22:14:36Z","closed_at":null,"body":"We frequently see this issue in elliptics:\r\n\r\n`# ls -l /proc/19808/fd/ | grep log\r\nl-wx------ 1 root root 64 Jul 28 01:49 3 -> /home/admin/elliptics/log/ioserv.log-2015.07.22-1437535502 (deleted)\r\n`\r\n\r\nioserv.log - elliptics log file - was moved by logrotate 6 days ago, but blackhole didn't notice that and didn't reopen logfile.\r\nHere is appropriate config section:\r\n```javascript\r\n        \"logger\": {\r\n                \"frontends\": [\r\n                        {\r\n                                \"formatter\": {\r\n                                        \"type\": \"string\",\r\n                                        \"pattern\": \"%(timestamp)s %(request_id)s/%(lwp)s/%(pid)s %(severity)s: %(message)s %(...L)s\"\r\n                                },\r\n                                \"sink\": {\r\n                                        \"type\": \"files\",\r\n                                        \"path\": \"/home/admin/elliptics/log/ioserv.log\",\r\n                                        \"autoflush\": true,\r\n                                        \"rotation\": {\r\n                                                \"move\": 0\r\n                                        }\r\n                                }\r\n                        }\r\n                ],\r\n                \"level\": \"info\"\r\n        },\r\n```\r\n\r\nWe use blackhole 0.2 if that matters. Rotation changed a little bit - there were introduced additional checks which might explain why 'size' rotation doesn't work in 0.2, but common 'move' logic is the same afaics.\r\n\r\nIt doesn't happen all the time, but yet quite frequently."},"comment":{"url":"https://api.github.com/repos/3Hren/blackhole/issues/comments/126112137","html_url":"https://github.com/3Hren/blackhole/issues/58#issuecomment-126112137","issue_url":"https://api.github.com/repos/3Hren/blackhole/issues/58","id":126112137,"user":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T22:14:36Z","updated_at":"2015-07-29T22:14:36Z","body":"There is no stderr/stdout output since elliptics closes those descriptors at startup when going daemon.\r\nBut there can not be any permission violation since server runs with superuser privileges on a bare metal server without containerisation.\r\n\r\nI suppose that if there would be write access trouble, it would fire up every time logrotate runs, but in practice this happens occasionally on any given server - more like race condition"}}