This patch provides and Upstart job and a systemd unit. It also adds
some build-dependencies.
Change-Id: I7983418426a4bf70a36b5b19e0d5c8e90543d590
Signed-off-by: Akshita <zenith158@gmail.com>
Signed-off-by: Akshita Jha <zenith158@gmail.com>
Source: opendaylight
-Build-Depends: debhelper (>= 9),
+Build-Depends: debhelper (>= 9), wget, ca-certificates, dh-systemd
Maintainer: Akshita Jha <zenith158@gmail.com>
Package: opendaylight
-Depends: ${misc:Depends}
+Depends: ${misc:Depends}, adduser
Architecture: any
Description: OpenDaylight SDN controller
--- /dev/null
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure)
+ adduser --system --disabled-password --disabled-login --home /opt/opendaylight \
+ --no-create-home --quiet --force-badname --group odl
+ chown -R odl:odl /opt/opendaylight/
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+[Unit]
+Description=OpenDaylight SDN Controller
+Documentation=https://wiki.opendaylight.org/view/Main_Page http://www.opendaylight.org/
+After=network.service
+
+[Service]
+Type=forking
+ExecStart=/opt/opendaylight/bin/start
+User=odl
+Group=odl
+SuccessExitStatus=143
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+description "OpenDaylight SDN Controller"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+respawn
+respawn limit 5 60
+expect daemon
+
+exec /opt/opendaylight/bin/start
URL = "https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/$(VERSION)/$(TARBALL)"
%:
- dh $@
+ dh $@ --with systemd
override_dh_auto_clean:
override_dh_auto_test: