Providing an Upstart job and systemd unit to ODL .deb package 84/40584/5
authorAkshita <zenith158@gmail.com>
Tue, 21 Jun 2016 07:05:31 +0000 (12:35 +0530)
committerAkshita Jha <zenith158@gmail.com>
Thu, 23 Jun 2016 12:00:11 +0000 (17:30 +0530)
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>
deb/debian/control
deb/debian/opendaylight.postinst [new file with mode: 0644]
deb/debian/opendaylight.service [new file with mode: 0644]
deb/debian/opendaylight.upstart [new file with mode: 0644]
deb/debian/rules

index edf383bbc0a97ec7c0c3384fbec5f20f29b5d1f3..2826a1f6772f218589144736213b962b4feda348 100644 (file)
@@ -1,9 +1,9 @@
 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
 
diff --git a/deb/debian/opendaylight.postinst b/deb/debian/opendaylight.postinst
new file mode 100644 (file)
index 0000000..d3e4e89
--- /dev/null
@@ -0,0 +1,15 @@
+#!/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
diff --git a/deb/debian/opendaylight.service b/deb/debian/opendaylight.service
new file mode 100644 (file)
index 0000000..7548f95
--- /dev/null
@@ -0,0 +1,14 @@
+[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
diff --git a/deb/debian/opendaylight.upstart b/deb/debian/opendaylight.upstart
new file mode 100644 (file)
index 0000000..84f0032
--- /dev/null
@@ -0,0 +1,9 @@
+description "OpenDaylight SDN Controller"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+respawn
+respawn limit 5 60
+expect daemon
+
+exec /opt/opendaylight/bin/start
index 2dbbd065df7c156d21f5e8712f49cdca11213121..242f083c8d04cfc795b857cbdf403f056e76fd50 100755 (executable)
@@ -9,7 +9,7 @@ TARBALL = distribution-karaf-$(VERSION).tar.gz
 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: