2013-11-15 13:21:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
2014-04-03 02:24:15 +00:00
|
|
|
set -o pipefail
|
2013-11-15 13:21:56 +00:00
|
|
|
|
|
|
|
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
|