summaryrefslogtreecommitdiff
path: root/debian_template
diff options
context:
space:
mode:
Diffstat (limited to 'debian_template')
-rw-r--r--debian_template/changelog2
-rw-r--r--debian_template/control2
-rwxr-xr-xdebian_template/rules6
-rwxr-xr-xdebian_template/rvi.init70
-rw-r--r--debian_template/rvi.postinst9
-rw-r--r--debian_template/rvi.postrm21
-rw-r--r--debian_template/rvi.service10
7 files changed, 91 insertions, 29 deletions
diff --git a/debian_template/changelog b/debian_template/changelog
index 378c78c..3d774a4 100644
--- a/debian_template/changelog
+++ b/debian_template/changelog
@@ -1,4 +1,4 @@
-rvi (0.5.0) jessie; urgency=low
+rvi (0.5.0-1) jessie; urgency=low
* Initial release
diff --git a/debian_template/control b/debian_template/control
index a112832..bab7968 100644
--- a/debian_template/control
+++ b/debian_template/control
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Magnus Feuer <mfeuer@jaguarlandrover.com>
Build-Depends: debhelper (>= 9), libbluetooth-dev, esl-erlang (>= 1:18.2)
-Standards-Version: 3.9.5
+Standards-Version: 3.9.6
Homepage: https://github.com/PDXostc/rvi_core
Package: rvi
diff --git a/debian_template/rules b/debian_template/rules
index f332d29..fc2f6c0 100755
--- a/debian_template/rules
+++ b/debian_template/rules
@@ -5,7 +5,7 @@
export DH_VERBOSE=1
%:
- dh --with systemd $@
+ dh $@
override_dh_auto_install:
./scripts/rvi_install \
@@ -18,6 +18,4 @@ override_dh_auto_install:
# Copy out rvi_ctl to /usr/bin
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.debian ./debian/rvi/etc/init.d/rvi
+ install -D -m 0644 ./priv/config/rvi_debian.config ./debian/rvi/etc/rvi/rvi.config
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
+
diff --git a/debian_template/rvi.postinst b/debian_template/rvi.postinst
index f6d5de5..10c11fe 100644
--- a/debian_template/rvi.postinst
+++ b/debian_template/rvi.postinst
@@ -23,10 +23,10 @@ set -e
case "$1" in
configure)
- # Set up our config for apache
+ # Set up our config
cat /proc/sys/kernel/random/uuid > /etc/rvi/device_id
echo "RVI Device ID set to $(cat /etc/rvi/device_id) in /etc/rvi/device_id"
- update-rc.d rvi defaults
+ #DEBHELPER#
;;
abort-upgrade|abort-remove|abort-deconfigure)
@@ -40,11 +40,6 @@ case "$1" in
esac
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
db_stop
exit 0
diff --git a/debian_template/rvi.postrm b/debian_template/rvi.postrm
index 0ded6f8..a0c5d5b 100644
--- a/debian_template/rvi.postrm
+++ b/debian_template/rvi.postrm
@@ -6,14 +6,15 @@
set -e
# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
@@ -24,7 +25,7 @@ case "$1" in
remove|purge|upgrde|disappear)
rm -f /etc/init.d/rvi
- update-rc.d rvi remove
+ #DEBHELPER#
;;
*)
@@ -34,8 +35,6 @@ case "$1" in
esac
-#DEBHELPER#
-
db_stop
exit 0
diff --git a/debian_template/rvi.service b/debian_template/rvi.service
index 5e98259..d9ae979 100644
--- a/debian_template/rvi.service
+++ b/debian_template/rvi.service
@@ -1,18 +1,18 @@
-# systemd(8) setup usde by Tizen and others.
+# systemd(8) setup for Debian
[Unit]
Description=Remote Vehicle Interaction Service
Wants=network-online.target
[Service]
-Environment="HOME=/usr/lib/rvi"
+Environment="HOME=/usr/lib/rvi_core"
Type=forking
StandardOutput=journal
StandardError=journal
-#ExecStartPre=/opt/rvi-0.5.0/erts-5.10.4/bin/epmd -daemon
-ExecStart=/bin/sh /usr/bin/rvi_ctl -c /etc/rvi/rvi.config start
-ExecStop=/bin/sh /usr/bin/rvi_ctl stop
+ExecStart=/usr/bin/rvi_ctl -c /etc/rvi/rvi.config start
+ExecStop=/usr/bin/rvi_ctl stop
GuessMainPID=yes
+RemainAfterExit=yes
[Install]
WantedBy=graphical.target multi-user.target