{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/bosh-cli/issues/447","repository_url":"https://api.github.com/repos/cloudfoundry/bosh-cli","labels_url":"https://api.github.com/repos/cloudfoundry/bosh-cli/issues/447/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/bosh-cli/issues/447/comments","events_url":"https://api.github.com/repos/cloudfoundry/bosh-cli/issues/447/events","html_url":"https://github.com/cloudfoundry/bosh-cli/issues/447","id":335793974,"node_id":"MDU6SXNzdWUzMzU3OTM5NzQ=","number":447,"title":"`bosh logs` doesn't cleanup after itself","user":{"login":"kayrus","id":4047483,"node_id":"MDQ6VXNlcjQwNDc0ODM=","avatar_url":"https://avatars2.githubusercontent.com/u/4047483?v=4","gravatar_id":"","url":"https://api.github.com/users/kayrus","html_url":"https://github.com/kayrus","followers_url":"https://api.github.com/users/kayrus/followers","following_url":"https://api.github.com/users/kayrus/following{/other_user}","gists_url":"https://api.github.com/users/kayrus/gists{/gist_id}","starred_url":"https://api.github.com/users/kayrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kayrus/subscriptions","organizations_url":"https://api.github.com/users/kayrus/orgs","repos_url":"https://api.github.com/users/kayrus/repos","events_url":"https://api.github.com/users/kayrus/events{/privacy}","received_events_url":"https://api.github.com/users/kayrus/received_events","type":"User","site_admin":false},"labels":[{"id":435237897,"node_id":"MDU6TGFiZWw0MzUyMzc4OTc=","url":"https://api.github.com/repos/cloudfoundry/bosh-cli/labels/unscheduled","name":"unscheduled","color":"D9D9D9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-26T12:22:41Z","updated_at":"2018-09-17T16:04:58Z","closed_at":null,"author_association":"NONE","body":"Since `bosh logs` uses non-interactive mode, it just kills the local ssh client process, but the server side `tail` process remains running. After certain `bosh logs` commands you'll receive an amount of stale `sudo tail -F` processes on the remove server.\r\n\r\nI tried to find a workaround for this issue, and I cannot develop anything better than pseudo-interactive shell..."},"comment":{"url":"https://api.github.com/repos/cloudfoundry/bosh-cli/issues/comments/422074762","html_url":"https://github.com/cloudfoundry/bosh-cli/issues/447#issuecomment-422074762","issue_url":"https://api.github.com/repos/cloudfoundry/bosh-cli/issues/447","id":422074762,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjA3NDc2Mg==","user":{"login":"jaresty","id":1313844,"node_id":"MDQ6VXNlcjEzMTM4NDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1313844?v=4","gravatar_id":"","url":"https://api.github.com/users/jaresty","html_url":"https://github.com/jaresty","followers_url":"https://api.github.com/users/jaresty/followers","following_url":"https://api.github.com/users/jaresty/following{/other_user}","gists_url":"https://api.github.com/users/jaresty/gists{/gist_id}","starred_url":"https://api.github.com/users/jaresty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaresty/subscriptions","organizations_url":"https://api.github.com/users/jaresty/orgs","repos_url":"https://api.github.com/users/jaresty/repos","events_url":"https://api.github.com/users/jaresty/events{/privacy}","received_events_url":"https://api.github.com/users/jaresty/received_events","type":"User","site_admin":false},"created_at":"2018-09-17T16:04:58Z","updated_at":"2018-09-17T16:04:58Z","author_association":"MEMBER","body":"@kayrus The problem we saw was related to whitespace and line wrapping.  We tried running `bosh logs -f` against a zookeeper deployment with and without   the changes from https://github.com/cloudfoundry/bosh-cli/pull/448/files and compared the results. With the changes, many output lines were prepended with seemingly arbitrary whitespace and wrapping such that it was clear that the `logs -f` output had changed significantly and unintentionally.  Here is an example with the changes:\r\n\r\n```\r\n                                                                 zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ;; Query time: 0 msec\r\n                                                                                                                                               zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ;; SERVER: 169.254.0.2#53(169.254.0.2)\r\n                                                                                                                                                                                                                                              zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ;; WHEN: Tue Sep 11 00:37:07 UTC 2018\r\n                zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ;; MSG SIZE  rcvd: 66\r\n                                                                                              zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                                                                                                                                                       zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                                                                                                                                                                                                                zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ==> /var/vcap/sys/log/bosh-dns/pre-start.stderr.log <==\r\n    zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | + chown -R vcap:vcap /var/vcap/sys/log/bosh-dns\r\n                                                                                                            zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | + mkdir -p /var/vcap/sys/run/bosh-dns\r\n                                                                                                                                                                                                          zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | + chown -R vcap:vcap /var/vcap/sys/run/bosh-dns\r\n                       zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | + start_logging\r\n                                                              zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | + exec\r\n                                                                                                                             zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | + exec\r\n                                                                                                                                                                                            zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ++ prepend_datetime\r\n                                                                                                                                                                                                                                                                        zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ++ awk -W interactive '{ system(\"echo -n [$(date +\\\"%Y-%m-%d %H:%M:%S%z\\\")]\"); print \" \" $0 }'\r\n                                                                                                   zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ++ prepend_datetime\r\n                                                                                                                                                                               zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ++ awk -W interactive '{ system(\"echo -n [$(date +\\\"%Y-%m-%d %H:%M:%S%z\\\")]\"); print \" \" $0 }'\r\n          zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                                                                   zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ==> /var/vcap/sys/log/bosh-dns/pre-start.stdout.log <==\r\n                                                                                                                                                                                   zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                                                                                                                                                                                                                                            zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ==> /var/vcap/sys/log/zookeeper/pre-start.stderr.log <==\r\n                                 zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                                                                                          zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ==> /var/vcap/sys/log/zookeeper/pre-start.stdout.log <==\r\n                                                                                                                                                                                                           zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                                                                                                                                                                                                                                                                    zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ==> /var/vcap/sys/log/zookeeper/stderr.log <==\r\n                                               zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ZooKeeper JMX enabled by default\r\n                                                                                                                                        zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | Using config: /var/vcap/jobs/zookeeper/config/zoo.cfg\r\n                                                                                                                                                                                                                                                      zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout |\r\n                    zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | ==> /var/vcap/sys/log/zookeeper/stdout.log <==\r\n                                                                                          zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-13 00:36:57 INFO  DatadirCleanupManager:138 - Purge task started.\r\n                                                                                                                                                                                                                            zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-13 00:36:57 INFO  DatadirCleanupManager:144 - Purge task completed.\r\n                                    zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-14 00:36:57 INFO  DatadirCleanupManager:138 - Purge task started.\r\n                                                                                                                                                                      zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-14 00:36:57 INFO  DatadirCleanupManager:144 - Purge\r\ntask completed.\r\n               zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-15 00:36:57 INFO  DatadirCleanupManager:138 - Purge task started.\r\n                                                                                                                zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-15 00:36:57 INFO  DatadirCleanupManager:144 - Purge task completed.\r\n                                                                                                                                                                                                                                                    zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-16 00:36:57 INFO  DatadirCleanupManager:138 - Purge task started.\r\n                                                          zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-16 00:36:57 INFO  DatadirCleanupManager:144 - Purge task completed.\r\n                                                                                                                                                                                              zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-17 00:36:57 INFO  DatadirCleanupManager:138 - Purge task started.\r\n    zookeeper/5253f374-c75a-486d-b1ef-9203f9e97a7d: stdout | 2018-09-17 00:36:57 INFO  DatadirCleanupManager:144 - Purge task completed.\r\n```\r\n\r\nAnd here it is without:\r\n```\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | {\"records\":[[\"10.0.1.6\",\"45c0e783-1b95-45e8-8c22-00cfdf804c59.smoke-tests.default.zookeeper.bosh\"],[\"10.0.1.5\",\"737f7380-1533-4b8a-9245-d79eb7198a04.blank.default.blank.bosh\"],[\"10.0.1.0\",\"494babd0-fa62-41fe-b6b2-900417ccb7e2.zookeeper.default.zookeeper.bosh\"],[\"10.0.1.3\",\"63a2bfa1-aafd-44bd-85a7-e97e7ec39dc1.zookeeper.default.zookeeper.bosh\"],[\"10.0.1.1\",\"2ac953f8-a554-43ed-9653-90971480d97f.zookeeper.default.zookeeper.bosh\"],[\"10.0.1.4\",\"9b80c594-9da6-4618-a5e0-5180a6ab1aab.zookeeper.default.zookeeper.bosh\"],[\"10.0.1.2\",\"5253f374-c75a-486d-b1ef-9203f9e97a7d.zookeeper.default.zookeeper.bosh\"]],\"version\":223,\"record_keys\":[\"id\",\"num_id\",\"instance_group\",\"group_ids\",\"az\",\"az_id\",\"network\",\"network_id\",\"deployment\",\"ip\",\"domain\",\"agent_id\",\"instance_index\"],\"record_infos\":[[\"45c0e783-1b95-45e8-8c22-00cfdf804c59\",\"108\",\"smoke-tests\",[\"21\"],\"z1\",\"1\",\"default\",\"2\",\"zookeeper\",\"10.0.1.6\",\"bosh\",\"a4535e6c-5813-48c0-ab6d-e7801b8fa847\",0],[\"737f7380-1533-4b8a-9245-d79eb7198a04\",\"620\",\"blank\",[\"23\"],\"z1\",\"1\",\"default\",\"2\",\"blank\",\"10.0.1.5\",\"bosh\",\"11ad8d35-214e-48b9-8324-2e5bb199933b\",0],[\"494babd0-fa62-41fe-b6b2-900417ccb7e2\",\"105\",\"zookeeper\",[\"20\"],\"z1\",\"1\",\"default\",\"2\",\"zookeeper\",\"10.0.1.0\",\"bosh\",\"2c96a0dd-ca73-44bc-9e41-2c8ca7b3a81b\",0],[\"63a2bfa1-aafd-44bd-85a7-e97e7ec39dc1\",\"618\",\"zookeeper\",[\"20\"],\"z1\",\"1\",\"default\",\"2\",\"zookeeper\",\"10.0.1.3\",\"bosh\",\"83a092a0-10b9-40ac-a15d-a3dd516f2b2b\",3],[\"2ac953f8-a554-43ed-9653-90971480d97f\",\"106\",\"zookeeper\",[\"20\"],\"z2\",\"2\",\"default\",\"2\",\"zookeeper\",\"10.0.1.1\",\"bosh\",\"c154e6bd-c93b-44d2-8018-3ec0a3762a04\",1],[\"9b80c594-9da6-4618-a5e0-5180a6ab1aab\",\"619\",\"zookeeper\",[\"20\"],\"z2\",\"2\",\"default\",\"2\",\"zookeeper\",\"10.0.1.4\",\"bosh\",\"52fe29ce-029d-43ce-926b-c813f28a21ff\",4],[\"5253f374-c75a-486d-b1ef-9203f9e97a7d\",\"107\",\"zookeeper\",[\"20\"],\"z3\",\"3\",\"default\",\"2\",\"zookeeper\",\"10.0.1.2\",\"bosh\",\"6ba01991-be77-41d6-8c5b-38c71147e113\",2]]}\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ********************\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout |\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ==> /var/vcap/sys/log/bosh-dns/post-start.stderr.log <==\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + dig +tcp +time=10 +tries=1 -p 53 upcheck.bosh-dns. @169.254.0.2\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + dig +notcp +time=10 +tries=1 -p 53 upcheck.bosh-dns. @169.254.0.2\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout |\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ==> /var/vcap/sys/log/bosh-dns/post-start.stdout.log <==\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ;upcheck.bosh-dns.             IN      A\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout |\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ;; ANSWER SECTION:\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | upcheck.bosh-dns.      0       IN      A       127.0.0.1\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout |\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ;; Query time: 0 msec\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ;; SERVER: 169.254.0.2#53(169.254.0.2)\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ;; WHEN: Tue Sep 11 00:33:00 UTC 2018\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ;; MSG SIZE  rcvd: 66\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout |\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout |\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ==> /var/vcap/sys/log/bosh-dns/pre-start.stderr.log <==\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + chown -R vcap:vcap /var/vcap/sys/log/bosh-dns\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + mkdir -p /var/vcap/sys/run/bosh-dns\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + chown -R vcap:vcap /var/vcap/sys/run/bosh-dns\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + start_logging\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + exec\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | + exec\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ++ prepend_datetime\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ++ awk -W interactive '{ system(\"echo -n [$(date +\\\"%Y-%m-%d %H:%M:%S%z\\\")]\"); print \" \" $0 }'\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ++ prepend_datetime\r\nzookeeper/9b80c594-9da6-4618-a5e0-5180a6ab1aab: stdout | ++ awk -W interactive '{ system(\"echo -n [$(date +\\\"%Y-%m-%d %H:%M:%S%z\\\")]\"); print \" \" $0 }'\r\n```"}}
{"actor":{"display_login":"jaresty"}}