GitLab upgraded to 13.6.1-ee.0 - changelog: https://gitlab.com/gitlab-org/gitlab/blob/master/CHANGELOG-EE.md

README.md 3.59 KB
Newer Older
Tim Smith's avatar
Tim Smith committed
1 2 3 4 5 6 7
# dpkg_autostart cookbook

[![Cookbook Version](https://img.shields.io/cookbook/v/dpkg_autostart.svg)](https://supermarket.chef.io/cookbooks/dpkg_autostart)
[![Build Status](https://img.shields.io/circleci/project/github/sous-chefs/atom/master.svg)](https://circleci.com/gh/sous-chefs/atom)
[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
Chris Roberts's avatar
Chris Roberts committed
8 9 10 11 12

`dpkg` likes to start services after installation as the Debian convention
dictates. This can be annoying and problematic, especially when you don't
want services to be immediately started before custom configuration can
be applied. Instead of disabling all services from auto starting on installation
Tim Smith's avatar
Tim Smith committed
13
as the `dpkg_deb_unautostart` cookbook does, lets allow specific services
Chris Roberts's avatar
Chris Roberts committed
14 15 16 17
to be targeted.

## Usage

Tim Smith's avatar
Tim Smith committed
18
### Resource
Chris Roberts's avatar
Chris Roberts committed
19 20 21 22 23 24 25

Include the cookbook as a dependency in your metadata:

```ruby
depends 'dpkg_autostart'
```

Tim Smith's avatar
Tim Smith committed
26
Then, within your recipe, disable the service with the resource:
Chris Roberts's avatar
Chris Roberts committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

```ruby
dpkg_autostart 'mysql-server' do
  allow false
end
```

That's it. When `dpkg` attempts to start the service after install (generally
via `apt`) it will be instructed not to. This allows the proper configuration
files to be generated, and the service to be started after everything is
ready.

### Attribute

You can also provide a list of services to disable via node attribute. Add
the default recipe to the run list:

```ruby
run_list 'recipe[dpkg_autostart]'
```

and set the services you want to restrict from auto starting:

```ruby
Tim Smith's avatar
Tim Smith committed
51
node.default['dpkg_autostart']['disabled_services'] = ['mysql-server', 'apache2']
Chris Roberts's avatar
Chris Roberts committed
52 53 54
```

## Related
Tim Smith's avatar
Tim Smith committed
55

Tim Smith's avatar
Tim Smith committed
56
- deb_pkg_unautostart: <http://ckbk.it/deb_pkg_unautostart>
Tim Smith's avatar
Tim Smith committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81

## Contributors

This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)

### Backers

Thank you to all our backers!

![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600&avatarHeight=40)

### Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)