{"action":"opened","number":915,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/915","id":77791328,"html_url":"https://github.com/saltstack/salt-bootstrap/pull/915","diff_url":"https://github.com/saltstack/salt-bootstrap/pull/915.diff","patch_url":"https://github.com/saltstack/salt-bootstrap/pull/915.patch","issue_url":"https://api.github.com/repos/saltstack/salt-bootstrap/issues/915","number":915,"state":"open","locked":false,"title":"Fix bootstrapping from Git on CentOS7 when `systemd` is not running","user":{"login":"vutny","id":16338056,"avatar_url":"https://avatars.githubusercontent.com/u/16338056?v=3","gravatar_id":"","url":"https://api.github.com/users/vutny","html_url":"https://github.com/vutny","followers_url":"https://api.github.com/users/vutny/followers","following_url":"https://api.github.com/users/vutny/following{/other_user}","gists_url":"https://api.github.com/users/vutny/gists{/gist_id}","starred_url":"https://api.github.com/users/vutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vutny/subscriptions","organizations_url":"https://api.github.com/users/vutny/orgs","repos_url":"https://api.github.com/users/vutny/repos","events_url":"https://api.github.com/users/vutny/events{/privacy}","received_events_url":"https://api.github.com/users/vutny/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\nIf you'd like to build a CentOS 7 container/VM image containing Salt using `docker build` or `Packer` etc with `bootstrap-salt.sh`, it will fail to perform `git` installation type.\r\n\r\nThe main problem is in `install_centos_git_post()` function which executes `/bin/systemctl daemon-reload` at the very end. As a result, if `systemd` is not running (because we're building an image and there is no init system running on target), later logic in the script detects the return code not equal to `0` and aborts execution.\r\n\r\nBy this PR the post install functions will always return `0`. Also, I've made some optimizations to execute `/bin/systemctl` only when it is necessary.\r\n\r\n### Previous Behavior\r\nGit installation type fails when building OS images:\r\n```\r\n *  INFO: Running install_centos_git_post()\r\n * DEBUG: The passed destination(/usr/lib/systemd/system/) is a directory\r\n * DEBUG: Full destination path is now: /usr/lib/systemd/system//salt-minion.service\r\n * DEBUG: Copying /tmp/git/salt/pkg/rpm/salt-minion.service to /usr/lib/systemd/system//salt-minion.service\r\nCreated symlink from /etc/systemd/system/multi-user.target.wants/salt-minion.service to /usr/lib/systemd/system/salt-minion.service.\r\nCreated symlink from /etc/systemd/system/multi-user.target.wants/salt-master.service to /usr/lib/systemd/system/salt-master.service.\r\n * DEBUG: The passed destination(/usr/lib/systemd/system/) is a directory\r\n * DEBUG: Full destination path is now: /usr/lib/systemd/system//salt-api.service\r\n * DEBUG: Copying /tmp/git/salt/pkg/rpm/salt-api.service to /usr/lib/systemd/system//salt-api.service\r\nFailed to get D-Bus connection: Operation not permitted\r\n * ERROR: Failed to run install_centos_git_post()!!!\r\n * DEBUG: Cleaning up the Salt Temporary Git Repository\r\n * DEBUG: Removing the logging pipe /tmp/bootstrap-salt.logpipe\r\n * DEBUG: Killing logging pipe tee's with pid(s): 35\r\n```\r\n\r\n### New Behavior\r\nGit installation type succeeds.\r\n","created_at":"2016-07-18T11:10:31Z","updated_at":"2016-07-18T11:10:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/915/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/915/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt-bootstrap/issues/915/comments","statuses_url":"https://api.github.com/repos/saltstack/salt-bootstrap/statuses/eae188d5740c98edf0c3f43fec40d896ef76b70a","head":{"label":"vutny:fix-centos7-git-container-build","ref":"fix-centos7-git-container-build","sha":"eae188d5740c98edf0c3f43fec40d896ef76b70a","user":{"login":"vutny","id":16338056,"avatar_url":"https://avatars.githubusercontent.com/u/16338056?v=3","gravatar_id":"","url":"https://api.github.com/users/vutny","html_url":"https://github.com/vutny","followers_url":"https://api.github.com/users/vutny/followers","following_url":"https://api.github.com/users/vutny/following{/other_user}","gists_url":"https://api.github.com/users/vutny/gists{/gist_id}","starred_url":"https://api.github.com/users/vutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vutny/subscriptions","organizations_url":"https://api.github.com/users/vutny/orgs","repos_url":"https://api.github.com/users/vutny/repos","events_url":"https://api.github.com/users/vutny/events{/privacy}","received_events_url":"https://api.github.com/users/vutny/received_events","type":"User","site_admin":false},"repo":{"id":48380988,"name":"salt-bootstrap","full_name":"vutny/salt-bootstrap","owner":{"login":"vutny","id":16338056,"avatar_url":"https://avatars.githubusercontent.com/u/16338056?v=3","gravatar_id":"","url":"https://api.github.com/users/vutny","html_url":"https://github.com/vutny","followers_url":"https://api.github.com/users/vutny/followers","following_url":"https://api.github.com/users/vutny/following{/other_user}","gists_url":"https://api.github.com/users/vutny/gists{/gist_id}","starred_url":"https://api.github.com/users/vutny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vutny/subscriptions","organizations_url":"https://api.github.com/users/vutny/orgs","repos_url":"https://api.github.com/users/vutny/repos","events_url":"https://api.github.com/users/vutny/events{/privacy}","received_events_url":"https://api.github.com/users/vutny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vutny/salt-bootstrap","description":"Generic Salt Bootstrap Script","fork":true,"url":"https://api.github.com/repos/vutny/salt-bootstrap","forks_url":"https://api.github.com/repos/vutny/salt-bootstrap/forks","keys_url":"https://api.github.com/repos/vutny/salt-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vutny/salt-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vutny/salt-bootstrap/teams","hooks_url":"https://api.github.com/repos/vutny/salt-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/vutny/salt-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/vutny/salt-bootstrap/events","assignees_url":"https://api.github.com/repos/vutny/salt-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/vutny/salt-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/vutny/salt-bootstrap/tags","blobs_url":"https://api.github.com/repos/vutny/salt-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vutny/salt-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vutny/salt-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/vutny/salt-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vutny/salt-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/vutny/salt-bootstrap/languages","stargazers_url":"https://api.github.com/repos/vutny/salt-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/vutny/salt-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/vutny/salt-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/vutny/salt-bootstrap/subscription","commits_url":"https://api.github.com/repos/vutny/salt-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/vutny/salt-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/vutny/salt-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/vutny/salt-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/vutny/salt-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/vutny/salt-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vutny/salt-bootstrap/merges","archive_url":"https://api.github.com/repos/vutny/salt-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vutny/salt-bootstrap/downloads","issues_url":"https://api.github.com/repos/vutny/salt-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/vutny/salt-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/vutny/salt-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/vutny/salt-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vutny/salt-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/vutny/salt-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/vutny/salt-bootstrap/deployments","created_at":"2015-12-21T16:04:43Z","updated_at":"2016-01-13T09:43:58Z","pushed_at":"2016-07-18T10:48:15Z","git_url":"git://github.com/vutny/salt-bootstrap.git","ssh_url":"git@github.com:vutny/salt-bootstrap.git","clone_url":"https://github.com/vutny/salt-bootstrap.git","svn_url":"https://github.com/vutny/salt-bootstrap","homepage":"","size":2856,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"saltstack:develop","ref":"develop","sha":"125232bc9f0012608d96fb0a0c621da4aa1baf91","user":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"repo":{"id":6910286,"name":"salt-bootstrap","full_name":"saltstack/salt-bootstrap","owner":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/saltstack/salt-bootstrap","description":"Generic Salt Bootstrap Script","fork":false,"url":"https://api.github.com/repos/saltstack/salt-bootstrap","forks_url":"https://api.github.com/repos/saltstack/salt-bootstrap/forks","keys_url":"https://api.github.com/repos/saltstack/salt-bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saltstack/salt-bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saltstack/salt-bootstrap/teams","hooks_url":"https://api.github.com/repos/saltstack/salt-bootstrap/hooks","issue_events_url":"https://api.github.com/repos/saltstack/salt-bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/saltstack/salt-bootstrap/events","assignees_url":"https://api.github.com/repos/saltstack/salt-bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/saltstack/salt-bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/saltstack/salt-bootstrap/tags","blobs_url":"https://api.github.com/repos/saltstack/salt-bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saltstack/salt-bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saltstack/salt-bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/saltstack/salt-bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saltstack/salt-bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/saltstack/salt-bootstrap/languages","stargazers_url":"https://api.github.com/repos/saltstack/salt-bootstrap/stargazers","contributors_url":"https://api.github.com/repos/saltstack/salt-bootstrap/contributors","subscribers_url":"https://api.github.com/repos/saltstack/salt-bootstrap/subscribers","subscription_url":"https://api.github.com/repos/saltstack/salt-bootstrap/subscription","commits_url":"https://api.github.com/repos/saltstack/salt-bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/saltstack/salt-bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/saltstack/salt-bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/saltstack/salt-bootstrap/issues/comments{/number}","contents_url":"https://api.github.com/repos/saltstack/salt-bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/saltstack/salt-bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saltstack/salt-bootstrap/merges","archive_url":"https://api.github.com/repos/saltstack/salt-bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saltstack/salt-bootstrap/downloads","issues_url":"https://api.github.com/repos/saltstack/salt-bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/saltstack/salt-bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/saltstack/salt-bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saltstack/salt-bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/saltstack/salt-bootstrap/releases{/id}","deployments_url":"https://api.github.com/repos/saltstack/salt-bootstrap/deployments","created_at":"2012-11-28T21:30:33Z","updated_at":"2016-07-16T02:59:15Z","pushed_at":"2016-07-14T23:13:06Z","git_url":"git://github.com/saltstack/salt-bootstrap.git","ssh_url":"git@github.com:saltstack/salt-bootstrap.git","clone_url":"https://github.com/saltstack/salt-bootstrap.git","svn_url":"https://github.com/saltstack/salt-bootstrap","homepage":"","size":4223,"stargazers_count":559,"watchers_count":559,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":359,"mirror_url":null,"open_issues_count":44,"forks":359,"open_issues":44,"watchers":559,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/915"},"html":{"href":"https://github.com/saltstack/salt-bootstrap/pull/915"},"issue":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/issues/915"},"comments":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/issues/915/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/915/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/pulls/915/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt-bootstrap/statuses/eae188d5740c98edf0c3f43fec40d896ef76b70a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":38,"deletions":33,"changed_files":1}}
{"actor":{"display_login":"vutny"}}