summaryrefslogtreecommitdiff
path: root/debian_template/rvi.init
diff options
context:
space:
mode:
authorRudolf J Streif <rstreif@debian.streifs.net>2016-02-15 12:49:29 -0800
committerRudolf J Streif <rstreif@debian.streifs.net>2016-02-15 12:49:29 -0800
commit576dfe598ca6b96bc28c71675bfd95eadaef15da (patch)
treeb5550b77edb50571ad6852503df35b45bc0fbaa4 /debian_template/rvi.init
parent5d2dff6d015af28802a28d10f72e73697ff67019 (diff)
downloadrvi_core-576dfe598ca6b96bc28c71675bfd95eadaef15da.tar.gz
Cleaned up SysVInit init and systemd service files
Removed the SysVInit init and system service files from the scripts subdirectory and added them to the packaging templates. Debian (and therefore also Ubuntu packaging) expect the init and service files in the packaging subdirectory from there debuild will pick them up automatically. Also adjusted the rules files in debian_template and ubuntu_template to remove the explicit copy of the init file. Added yocto_template to hold the init/service files for Yocto Project builds. Now all SysVInit init scripts and systemd service files are maintained with their respective OS template which makes things more transparent and compliant with the respective OS packaging rules. Signed-off-by: Rudolf J Streif <rudolf.streif@gmail.com>
Diffstat (limited to 'debian_template/rvi.init')
-rwxr-xr-xdebian_template/rvi.init70
1 files changed, 70 insertions, 0 deletions
diff --git a/debian_template/rvi.init b/debian_template/rvi.init
new file mode 100755
index 0000000..9cd4e59
--- /dev/null
+++ b/debian_template/rvi.init
@@ -0,0 +1,70 @@
+#!/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
+# Required-Start: $network $syslog $remote_fs
+# Required-Stop: $network $syslog $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/Stop RVI node at boot time
+# Description: Manage Remote Vehicle Interaction Node run state.
+### END INIT INFO
+
+export PATH="/bin/:/usr/bin:/sbin:/usr/sbin"
+export HOME=/usr/lib/rvi_core
+. /lib/lsb/init-functions
+
+set -e
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl -c /etc/rvi/rvi.config start; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ stop)
+ log_daemon_msg "Stopping Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl stop; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+
+ restart)
+ log_daemon_msg "Restarting Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl restart; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+
+ force-reload)
+ log_daemon_msg "Restarting Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl restart; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ *)
+ log_action_msg "Usage: /etc/init.d/rvi {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
+