Browse Source

To run onos as service, code added .

Change-Id: Ib2c91af1de30c0917fe2f01cc4cfdb3d6b532be7
Signed-off-by: sathishkumar_murugesan <sathishcold@gmail.com>
sathishkumar_murugesan 2 years ago
parent
commit
5fb03f31ca

BIN
deployment_scripts/puppet/modules/onos/files/networking-onos.tar View File


BIN
deployment_scripts/puppet/modules/onos/files/networking-sfc.tar View File


+ 21
- 0
deployment_scripts/puppet/modules/onos/files/onos.service View File

@@ -0,0 +1,21 @@
1
+[Unit]
2
+Description=ONOS
3
+After=
4
+
5
+
6
+[Service]
7
+User=root
8
+Group=root
9
+Type=simple
10
+WorkingDirectory=/opt/onos/apache-karaf-3.0.5
11
+PermissionsStartOnly=true
12
+ExecStartPre=
13
+ExecStart=/usr/lib/jvm/java-8-oracle/bin/java -server -Xms128M -Xmx512M -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dcom.sun.management.jmxremote -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/lib/endorsed:/opt/onos/apache-karaf-3.0.5/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/lib/jvm/java-8-oracle/lib/ext:/opt/onos/apache-karaf-3.0.5/lib/ext -Dkaraf.instances=/opt/onos/apache-karaf-3.0.5/instances -Dkaraf.home=/opt/onos/apache-karaf-3.0.5 -Dkaraf.base=/opt/onos/apache-karaf-3.0.5 -Dkaraf.data=/opt/onos/apache-karaf-3.0.5/data -Dkaraf.etc=/opt/onos/apache-karaf-3.0.5/etc -Djava.io.tmpdir=/opt/onos/apache-karaf-3.0.5/data/tmp -Djava.util.logging.config.file=/opt/onos/apache-karaf-3.0.5/etc/java.util.logging.properties -Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true -classpath /opt/onos/apache-karaf-3.0.5/lib/karaf-jaas-boot.jar:/opt/onos/apache-karaf-3.0.5/lib/karaf-org.osgi.core.jar:/opt/onos/apache-karaf-3.0.5/lib/karaf.jar org.apache.karaf.main.Main
14
+Restart=on-failure
15
+LimitNOFILE=65535
16
+TimeoutStopSec=15
17
+
18
+[Install]
19
+WantedBy=multi-user.target
20
+
21
+

+ 14
- 2
deployment_scripts/puppet/modules/onos/manifests/config.pp View File

@@ -11,7 +11,7 @@ class onos::config{
11 11
 
12 12
   $onos_pkg_name = $onos::onos_pkg_name
13 13
   $jdk8_pkg_name = $onos::jdk8_pkg_name
14
-  
14
+
15 15
   Exec {
16 16
     path       => "/usr/bin:/usr/sbin:/bin:/sbin",
17 17
     timeout    => 180,
@@ -38,12 +38,24 @@ class onos::config{
38 38
     content => template('onos/cluster.json.erb')
39 39
   }
40 40
 
41
+
42
+  file { '/etc/systemd/system/onos.service':
43
+    source => "puppet:///modules/onos/onos.service",
44
+  }
45
+
46
+  exec { "Running ONOS as a service":
47
+    command => "sudo systemctl daemon-reload;
48
+    sudo systemctl enable onos;
49
+    sudo systemctl start onos.service;
50
+    sudo systemctl status onos.service;"
51
+  }
52
+
41 53
   case $::operatingsystem {
42 54
     ubuntu: {
43 55
       file {'/etc/init/onos.conf':
44 56
         ensure  => file,
45 57
         content => template('onos/debian/onos.conf.erb')
46
-      } 
58
+      }
47 59
     }
48 60
     centos: {
49 61
       file {'/etc/init.d/onos':

+ 2
- 1
deployment_scripts/puppet/modules/onos/manifests/service.pp View File

@@ -31,7 +31,8 @@ class onos::service{
31 31
   }->
32 32
 
33 33
   exec { 'install feature openflow':
34
-    command => "/opt/onos/bin/onos 'feature:install onos-providers-openflow-base';
34
+    command => "/opt/onos/bin/onos 'feature:install onos-optical-model';
35
+    /opt/onos/bin/onos 'feature:install onos-providers-openflow-base';
35 36
     /opt/onos/bin/onos 'feature:install onos-providers-openflow-message'",
36 37
     tries     => 3,
37 38
     try_sleep => 5,

Loading…
Cancel
Save