HVAC Wiki

All things related to HVAC

User Tools

Site Tools


suppliers:hvac.io:graphivac:installation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
suppliers:hvac.io:graphivac:installation [2017/03/14 18:46] – created frozenlocksuppliers:hvac.io:graphivac:installation [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 3: Line 3:
 Graphivac server runs on [[http://www.java.com|Java]], meaning it can work on Linux, Windows and Mac. Graphivac server runs on [[http://www.java.com|Java]], meaning it can work on Linux, Windows and Mac.
  
-==== Java ====+===== Java =====
  
 Make sure you have Java on your machine. (preferably 8 or higher)  Make sure you have Java on your machine. (preferably 8 or higher) 
Line 14: Line 14:
 {{:suppliers:hvac.io:vigilia:installation:java-version.png|}} {{:suppliers:hvac.io:vigilia:installation:java-version.png|}}
  
-==== graphivac-server.jar ====+===== Graphivac Server =====
  
 The entire Graphivac server is contained within a single .jar file. The entire Graphivac server is contained within a single .jar file.
Line 29: Line 29:
 You can now take your browser and go to: You can now take your browser and go to:
 <code> http://localhost:<port number> </code> <code> http://localhost:<port number> </code>
 +
 +NB: When downloading new versions, you might need to rename the java file.
 +===== Adding Graphivac as a Service =====
 +
 +You might want to make sure the Graphivac server always starts as soon as the server boots, or that it restores itself in case of a crash.
 +
 +For this, you'll have to add Graphivac as a service.
 +
 +Start by creating a file named "**graphivac.conf**".
 +
 +Open it and paste the following:
 +
 +
 +<code bash graphivac.conf>
 +
 +description "Graphivac Server"
 +author "Christian Fortin, HVAC.IO"
 +
 +start on runlevel [2345]
 +stop on runlevel [!2345]
 +
 +
 +#Respawn the process if it crashes
 +#If it respawns more than 10 times in 60 seconds stop
 +respawn
 +respawn limit 10 60
 +
 +expect fork
 +
 +#replace PATH-TO-THE-JAR with something like /home/hvacio/graphivac
 +#replace PORT with the desired port number
 +script
 +    cd PATH-TO-THE-JAR
 +    java -jar graphivac-server.jar PORT &
 +end script
 +
 +</code>
 +
 +Now, once you replaced PATH-TO-THE-JAR and PORT with their correct values, move the file to /etc/init:
 +
 +<code>
 +sudo mv graphivac.conf /etc/init/graphivac.conf
 +</code>
 +
 +That's it!
 +Now reboot and Graphivac should start automatically.
 +
 +To get more info about Upstart and services, see http://upstart.ubuntu.com/cookbook/.
 +
  
  
suppliers/hvac.io/graphivac/installation.1489517170.txt.gz · Last modified: 2017/03/14 14:46 (external edit)