[lxc-devel] [PATCH 4/6] systemd: Ensure action() is defined

Martin Pitt martin.pitt at ubuntu.com
Thu Jul 31 06:53:54 UTC 2014


If /etc/rc.d/init.d/functions is not present or does not define an action()
function, provide a simple fallback using "echo".
---
 config/init/sysvinit/lxc.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/config/init/sysvinit/lxc.in b/config/init/sysvinit/lxc.in
index a850341..7cad8c8 100644
--- a/config/init/sysvinit/lxc.in
+++ b/config/init/sysvinit/lxc.in
@@ -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
-- 
2.0.1



More information about the lxc-devel mailing list