{"action":"created","issue":{"url":"https://api.github.com/repos/freedomofpress/securedrop/issues/965","labels_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/965/labels{/name}","comments_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/965/comments","events_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/965/events","html_url":"https://github.com/freedomofpress/securedrop/pull/965","id":65399581,"number":965,"title":"Mark GRUB as manually installed (fixes #945)","user":{"login":"ageis","id":1161532,"avatar_url":"https://avatars.githubusercontent.com/u/1161532?v=3","gravatar_id":"","url":"https://api.github.com/users/ageis","html_url":"https://github.com/ageis","followers_url":"https://api.github.com/users/ageis/followers","following_url":"https://api.github.com/users/ageis/following{/other_user}","gists_url":"https://api.github.com/users/ageis/gists{/gist_id}","starred_url":"https://api.github.com/users/ageis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ageis/subscriptions","organizations_url":"https://api.github.com/users/ageis/orgs","repos_url":"https://api.github.com/users/ageis/repos","events_url":"https://api.github.com/users/ageis/events{/privacy}","received_events_url":"https://api.github.com/users/ageis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/freedomofpress/securedrop/milestones/8","html_url":"https://github.com/freedomofpress/securedrop/milestones/0.3.2","labels_url":"https://api.github.com/repos/freedomofpress/securedrop/milestones/8/labels","id":1038845,"number":8,"title":"0.3.2","description":"","creator":{"login":"garrettr","id":407302,"avatar_url":"https://avatars.githubusercontent.com/u/407302?v=3","gravatar_id":"","url":"https://api.github.com/users/garrettr","html_url":"https://github.com/garrettr","followers_url":"https://api.github.com/users/garrettr/followers","following_url":"https://api.github.com/users/garrettr/following{/other_user}","gists_url":"https://api.github.com/users/garrettr/gists{/gist_id}","starred_url":"https://api.github.com/users/garrettr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garrettr/subscriptions","organizations_url":"https://api.github.com/users/garrettr/orgs","repos_url":"https://api.github.com/users/garrettr/repos","events_url":"https://api.github.com/users/garrettr/events{/privacy}","received_events_url":"https://api.github.com/users/garrettr/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":5,"state":"open","created_at":"2015-03-25T17:39:44Z","updated_at":"2015-04-01T15:24:56Z","due_on":"2015-04-06T07:00:00Z","closed_at":null},"comments":2,"created_at":"2015-03-31T08:45:05Z","updated_at":"2015-04-01T17:27:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/freedomofpress/securedrop/pulls/965","html_url":"https://github.com/freedomofpress/securedrop/pull/965","diff_url":"https://github.com/freedomofpress/securedrop/pull/965.diff","patch_url":"https://github.com/freedomofpress/securedrop/pull/965.patch"},"body":"This is intended to fix and address #945. Ultimately I came up with two equally viable solutions and decided to go with the simpler one, but I'll describe them here.\r\n\r\n@dolanjs had suggested simply setting the `grub-pc` package to be installed. This makes sense at first, however if you put that before the autoremove task then it has no effect - grub-pc is already installed, and so it's still marked as automatically installed and Ansible doesn't set it as manually installed which is what we really need. It still gets removed - so then you would have to think about removing GRUB first and then re-installing it afterward, which doesn't really make sense.\r\n\r\nSo here's another idea. We could create a file named `99grub` in `/etc/apt/apt.conf.d` with the following contents:\r\n```\r\nAPT\r\n{\r\n  NeverAutoRemove\r\n  {\r\n  \"^grub.*\";\r\n  };\r\n\r\n};\r\n```\r\nThis has the expected effect that any GRUB packages are never auto-removed. You don't even have to `update_cache=true`, just install that config any time before you run autoremove and it just works. However, although we already have a number of custom config files in our playbooks, this is ultimately more complexity, and one extra file, than we really need.\r\n\r\nSo the simplest thing to do is to use `apt-mark` to mark grub-pc as manually installed, which will \"prevent the package from being automatically removed if no other packages depend on it.\" This is what I did in the commit and it works very well."},"comment":{"url":"https://api.github.com/repos/freedomofpress/securedrop/issues/comments/88566355","html_url":"https://github.com/freedomofpress/securedrop/pull/965#issuecomment-88566355","issue_url":"https://api.github.com/repos/freedomofpress/securedrop/issues/965","id":88566355,"user":{"login":"dolanjs","id":1495205,"avatar_url":"https://avatars.githubusercontent.com/u/1495205?v=3","gravatar_id":"","url":"https://api.github.com/users/dolanjs","html_url":"https://github.com/dolanjs","followers_url":"https://api.github.com/users/dolanjs/followers","following_url":"https://api.github.com/users/dolanjs/following{/other_user}","gists_url":"https://api.github.com/users/dolanjs/gists{/gist_id}","starred_url":"https://api.github.com/users/dolanjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolanjs/subscriptions","organizations_url":"https://api.github.com/users/dolanjs/orgs","repos_url":"https://api.github.com/users/dolanjs/repos","events_url":"https://api.github.com/users/dolanjs/events{/privacy}","received_events_url":"https://api.github.com/users/dolanjs/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T17:27:50Z","updated_at":"2015-04-01T17:27:50Z","body":"lgtm"}}