/usr/lib/python2.7/dist-packages/charmtools/templates/python_services/files/hooks/services.py is in charm-tools 2.1.2-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!/usr/bin/python
from charmhelpers.core.services.base import ServiceManager
from charmhelpers.core.services import helpers
import actions
def manage():
manager = ServiceManager([
{
'service': '$metadata.package',
'ports': [], # ports to after start
'provided_data': [
# context managers for provided relations
# e.g.: helpers.HttpRelation()
],
'required_data': [
# data (contexts) required to start the service
# e.g.: helpers.RequiredConfig('domain', 'auth_key'),
# helpers.MysqlRelation(),
],
'data_ready': [
helpers.render_template(
source='upstart.conf',
target='/etc/init/$metadata.package'),
actions.log_start,
],
},
])
manager.manage()
|