Adding init-functions file for enviroment of LSB-compliant init scripts
In Ubuntu 14.04 and 16.04, the file of init-functions is placed in /lib/lsb/.
Change-Id: I101ee08a7b7795c41d9ec3eb8833bee0e2f38e1c
diff --git a/tools/package/init/onos.initd b/tools/package/init/onos.initd
index 95c2641..524e172 100755
--- a/tools/package/init/onos.initd
+++ b/tools/package/init/onos.initd
@@ -41,7 +41,12 @@
cmd=$1
shift
# Start ONOS as a daemon
- . /etc/init.d/functions && true
+ if test -f /lib/lsb/init-functions; then
+ . /lib/lsb/init-functions
+ else
+ . /etc/init.d/functions && true
+ fi
+
if type daemon | grep -i function >/dev/null 2>&1; then
# Use 'daemon' function if available
# Shell metacharacters are passed as arguments to daemon