diskimage-builder/elements/dib-init-system/dib-init-system
Monty Taylor 74487a383c Depend on ifupdown in simple-init
Newer distros, such as debian jessie and ubuntu xenial, do not provide
ifupdown by default, but simple-init depends on it. Add it to the pile.

Change-Id: I6f4876863c67c65a82464d4e0593015cdc839c5c
2016-02-20 08:19:21 -06:00

29 lines
528 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ -f /usr/bin/systemctl ]]; then
echo "systemd"
elif [[ -f /sbin/initctl ]]; then
echo "upstart"
elif [[ -f /etc/gentoo-release ]]; then
if [[ "${GENTOO_PROFILE}" =~ systemd ]]; then
echo "systemd"
else
echo "openrc"
fi
elif [[ -f /sbin/init ]]; then
if [[ -f /bin/systemd ]]; then
echo "systemd"
else
echo "sysv"
fi
else
echo "Unknown init system"
exit 1
fi