diff options
Diffstat (limited to 'yocto_template/rvi.init')
-rwxr-xr-x | yocto_template/rvi.init | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/yocto_template/rvi.init b/yocto_template/rvi.init new file mode 100755 index 0000000..069d78a --- /dev/null +++ b/yocto_template/rvi.init @@ -0,0 +1,73 @@ +#!/bin/sh +# +# Copyright (C) 2014, Jaguar Land Rover +# +# This program is licensed under the terms and conditions of the +# Mozilla Public License, version 2.0. The full text of the +# Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ +# +# +# Init.d script to start and stop an RVI system installed +# through an RPM. +# +### BEGIN INIT INFO +# Provides: rvi +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: RVI Framework +### END INIT INFO + + +export PATH="/bin/:/usr/bin:/sbin:/usr/sbin" +. /etc/init.d/functions + +set -e + +DAEMON_PATH="/opt/rvi_core" +DAEMON_NAME="rvi" + +case "$1" in + start) + echo -n "Starting $DAEMON_NAME: " + $DAEMON_PATH/rvi_ctl -c /etc/opt/rvi/rvi.config start + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + + stop) + echo -n "Stopping $DAEMON_NAME: " + $DAEMON_PATH/rvi_ctl stop + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + + restart) + echo -n "Restarting $DAEMON_NAME: " + $DAEMON_PATH/rvi_ctl restart + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + + status) + status $DAEMON_NAME + RETVAL=$? + ;; + + *) + echo "usage: $0 { start | stop | status | restart | status }" + ;; +esac + +exit $RETVAL |