summaryrefslogtreecommitdiff
path: root/ubuntu_template
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 /ubuntu_template
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 'ubuntu_template')
-rwxr-xr-xubuntu_template/rules2
-rwxr-xr-xubuntu_template/rvi.init70
2 files changed, 70 insertions, 2 deletions
diff --git a/ubuntu_template/rules b/ubuntu_template/rules
index 0d2cf19..b6b8c0a 100755
--- a/ubuntu_template/rules
+++ b/ubuntu_template/rules
@@ -19,5 +19,3 @@ override_dh_auto_install:
install -D -m 0755 ./debian/rvi/usr/lib/rvi_core/rvi_ctl ./debian/rvi/usr/bin/rvi_ctl
# Install default config
install -D -m 0644 ./priv/config/rvi_ubuntu.config ./debian/rvi/etc/rvi/rvi.config
-# Install start/stop scripts
- install -D -m 0755 ./scripts/rvi.init.ubuntu ./debian/rvi/etc/init.d/rvi
diff --git a/ubuntu_template/rvi.init b/ubuntu_template/rvi.init
new file mode 100755
index 0000000..9cd4e59
--- /dev/null
+++ b/ubuntu_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
+