diskimage-builder/elements/dib-init-system
Ian Wienand ff79dc9793 Catch errors in DIB_INIT_SYSTEM export
When you source a file that just does

 export FOO=$(bar)

you miss any invalid return codes from "bar" (even under -e) because
bash returns the value of the "export", which is 0

On centos-minimal, we stopped bringing in systemd early and this was
causing dib-init-system to not know what init was available.  Since it
did not fail correctly, it lead to confusing errors much later in the
build when service files were not copied correctly.  See also
I24ce648485c3d6f3c27ab8f87a638516b3727017

A dib-lint check is added.  One minor fixup is in 00-set-apt-sources
(this one is less likely to cause problems).  I have run dib-lint over
project-config elements and none use this pattern.

Change-Id: I076c08190d40c315ad6a6d96a3823e9fc52630be
2016-11-23 23:03:50 +00:00
..
environment.d Catch errors in DIB_INIT_SYSTEM export 2016-11-23 23:03:50 +00:00
install.d Add support for OpenRC to dib-init-system 2016-02-02 17:23:35 -06:00
post-install.d Add support for OpenRC to dib-init-system 2016-02-02 17:23:35 -06:00
pre-install.d Split dib-init-system into its own element 2015-03-25 13:28:38 -04:00
dib-init-system Depend on ifupdown in simple-init 2016-02-20 08:19:21 -06:00
README.rst Add init-scripts directory support 2015-07-16 17:59:05 +01:00

===============
dib-init-system
===============

Installs a script (dib-init-system) which outputs the type of init system in
use on the target image. Also sets an environment variable ``DIB_INIT_SYSTEM``
to this value.

Any files placed in a ``init-scripts/INIT_SYSTEM`` directory inside the
element will be copied into the appropriate directory if ``INIT_SYSTEM``
is in use on the host.

Environment Variables
---------------------

DIB_INIT_SYSTEM
  :Description: One of upstart, systemd, or sysv depending on the init system
    in use for the target image.