diskimage-builder/elements/dib-init-system/dib-init-system
Monty Taylor 12165f7b25 Split dib-init-system into its own element
Other elements need this and don't necessarily need base.

Change-Id: I3a12611d7d891a1fb0476f4095be522210b60cba
2015-03-25 13:28:38 -04:00

23 lines
369 B
Bash
Executable File

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