Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable service autostart on package install #229

Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Disable service autostart on package install

Debian and its derivatives will autostart services when installing
packages. However, often we need to configure installed software
before it is ready to run, so it's preferable to use Salt states and
requisites to handle package installation or upgrades, configuration
changes and service [re]starting.

Adding a policy-rc.d file with exit code 101 sets a policy which denies
this default behavior. Making this change in the install script also
prevents new builders from attempting to contact the Salt master before
they have been configured properly.
  • Loading branch information
aneeshusa committed Feb 29, 2016
commit 88a9116df175f0d3b9ff3590d90a890975f2d92b
@@ -8,6 +8,8 @@ install_salt () {
if [ "${OS_NAME}" = "linux" ]; then
printf "$0: installing salt for Linux\n"
# Use Trusty (Ubuntu 14.04) on Travis
# Don't autostart services
printf '#!/bin/sh\nexit 101\n' | sudo install -m 755 /dev/stdin /usr/sbin/policy-rc.d
curl https://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
printf 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8 trusty main\n' | sudo tee -a /etc/apt/sources.list >/dev/null
sudo apt-get -y update
@@ -5,6 +5,10 @@ base:
- common
- servo-dependencies

'os:Ubuntu':
- match: grain
- ubuntu

'servo-head':
- buildbot.slave
- android-dependencies
@@ -0,0 +1,2 @@
#!/bin/sh
exit 101
@@ -0,0 +1,8 @@
# Disable service autostart on package install
# Use Salt to manage service [re-]start on package change
/usr/sbin/policy-rc.d:
file.managed:
- user: root
- group: root
- mode: 755
- source: salt://{{ tpldir }}/files/policy-rc.d
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.