systemd: Ensure action() is defined

If /etc/rc.d/init.d/functions is not present or does not define an action()
function, provide a simple fallback using "echo".

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Martin Pitt 2014-07-31 08:53:54 +02:00 committed by Stéphane Graber
parent 65b27d845f
commit 84b3775a09

View File

@ -45,6 +45,13 @@ STOPOPTS="-a -A -s"
test ! -r "$sysconfdir"/rc.d/init.d/functions ||
. "$sysconfdir"/rc.d/init.d/functions
# provide action() fallback
if ! type action >/dev/null 2>&1; then
action() {
echo "$@"
}
fi
# Source any configurable options
test ! -r "$sysconfdir"/sysconfig/lxc ||
. "$sysconfdir"/sysconfig/lxc