bootils package

Bootils offers process boot-strapping utilities that support writing robust application/service launcher and process life-cycle management scripts.

It is comprised of a bootils Python package with building blocks for process and resource management, and a CLI tool named nanny that watches your child process after starting, until it grows up into a stable running state.

Copyright © 2015 1&1 Group <>

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


bootils.checks module

Check helpers + results.

class bootils.checks.CheckFormatter(formatting=u'text', stream=None, verbose=False)[source]

Bases: object

Emit a sequence of check results.

GLUE = {'yaml': (u'', u'', u''), 'json': (u'[\n', u',\n', u'\n]\n'), 'csv': (u'', u'', u''), 'tap': (u'', u'\n', u'\n'), 'text': (u'', u'\n', u'\n')}

Print any trailing output and clean up resources.


Print a single check result.


Unbuffered write of given text to output stream.

class bootils.checks.CheckResult(ok, name, comment, diagnostics)

Bases: tuple


Return self as a plain tuple. Used by copy and pickle.


Exclude the OrderedDict from pickling


Return a nicely formatted representation string


Alias for field number 2


Alias for field number 3


Alias for field number 1


Alias for field number 0

bootils.config module

Configuration utilities.

bootils.config.envvar(name, default=None)[source]

Return an environment variable specific for this application (using a prefix).


Return version information just like –version does.

bootils.launcher module

Service launcher and processc control.

class bootils.launcher.LauncherBase(config)[source]

Bases: object

Process launch & management.


Initialize process environment and return its old state.


Restore process environment to previous state as returned by init_environ.


Get numerical GID of a group.

Raises:KeyError – Unknown group name.

Get numerical UID of a user.

Raises:KeyError – Unknown user name.

Convert given signal specification to its integer value.

Parameters:sig_spec (int or str) – Either already an int, a number as a string, or a case-insensitive signal name.
Returns:Signal number.
Return type:int
Raises:ValueError – Bad / unknown signal name, or bad input type.