{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/beats/issues/6389","repository_url":"https://api.github.com/repos/elastic/beats","labels_url":"https://api.github.com/repos/elastic/beats/issues/6389/labels{/name}","comments_url":"https://api.github.com/repos/elastic/beats/issues/6389/comments","events_url":"https://api.github.com/repos/elastic/beats/issues/6389/events","html_url":"https://github.com/elastic/beats/issues/6389","id":297280809,"node_id":"MDU6SXNzdWUyOTcyODA4MDk=","number":6389,"title":"Beat uninstall-service-[beatname].ps1 do not stop the service before remove","user":{"login":"palethorper","id":540734,"node_id":"MDQ6VXNlcjU0MDczNA==","avatar_url":"https://avatars3.githubusercontent.com/u/540734?v=4","gravatar_id":"","url":"https://api.github.com/users/palethorper","html_url":"https://github.com/palethorper","followers_url":"https://api.github.com/users/palethorper/followers","following_url":"https://api.github.com/users/palethorper/following{/other_user}","gists_url":"https://api.github.com/users/palethorper/gists{/gist_id}","starred_url":"https://api.github.com/users/palethorper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palethorper/subscriptions","organizations_url":"https://api.github.com/users/palethorper/orgs","repos_url":"https://api.github.com/users/palethorper/repos","events_url":"https://api.github.com/users/palethorper/events{/privacy}","received_events_url":"https://api.github.com/users/palethorper/received_events","type":"User","site_admin":false},"labels":[{"id":238260883,"node_id":"MDU6TGFiZWwyMzgyNjA4ODM=","url":"https://api.github.com/repos/elastic/beats/labels/:Windows","name":":Windows","color":"ffffff","default":false},{"id":78874874,"node_id":"MDU6TGFiZWw3ODg3NDg3NA==","url":"https://api.github.com/repos/elastic/beats/labels/enhancement","name":"enhancement","color":"fbca04","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-14T23:20:24Z","updated_at":"2018-08-23T07:36:46Z","closed_at":null,"author_association":"NONE","body":"The uninstall-service-[beatname].ps1 script do not have a section to stop the service before removing it.\r\nThe install script do already include the log to atop the service before installing new version.\r\n\r\n- Operationing System : Windows\r\n- Version: up to 6.2.1\r\n\r\n- Steps to reproduce:\r\n1. Have a beat (filebeat, winlogbeat, metricbeat etc) service installed and running on windows\r\n2. Run the uninstall script that is included in the package. e.g. uninstall-service-filebeat.ps1\r\n\r\nThe uninstall will not succeed.\r\n\r\nFix:\r\nInclude the stop service log in the uninstall script\r\n`# delete service if it already exists\r\nif (Get-Service filebeat -ErrorAction SilentlyContinue) {\r\n  $service = Get-WmiObject -Class Win32_Service -Filter \"name='filebeat'\"\r\n  $service.StopService()\r\n  Start-Sleep -s 1\r\n  $service.delete()\r\n}`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/beats/issues/comments/415321242","html_url":"https://github.com/elastic/beats/issues/6389#issuecomment-415321242","issue_url":"https://api.github.com/repos/elastic/beats/issues/6389","id":415321242,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTMyMTI0Mg==","user":{"login":"michha","id":10424767,"node_id":"MDQ6VXNlcjEwNDI0NzY3","avatar_url":"https://avatars2.githubusercontent.com/u/10424767?v=4","gravatar_id":"","url":"https://api.github.com/users/michha","html_url":"https://github.com/michha","followers_url":"https://api.github.com/users/michha/followers","following_url":"https://api.github.com/users/michha/following{/other_user}","gists_url":"https://api.github.com/users/michha/gists{/gist_id}","starred_url":"https://api.github.com/users/michha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michha/subscriptions","organizations_url":"https://api.github.com/users/michha/orgs","repos_url":"https://api.github.com/users/michha/repos","events_url":"https://api.github.com/users/michha/events{/privacy}","received_events_url":"https://api.github.com/users/michha/received_events","type":"User","site_admin":false},"created_at":"2018-08-23T07:36:46Z","updated_at":"2018-08-23T07:36:46Z","author_association":"NONE","body":"As I look into https://github.com/elastic/beats/blob/master/dev-tools/packaging/templates/windows/uninstall-service.ps1.tmpl it has the StopService call implemented, but filebeat-6.3.2 x64 (24th July) is still missing the StopService in the uninstall PowerShell script"}}
{"actor":{"display_login":"michha"}}