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
Next revisionBoth sides next revision
suppliers:hvac.io:graphivac:installation [2017/03/14 18:46] – created frozenlocksuppliers:hvac.io:graphivac:installation [2020/07/23 12:26] – old revision restored (2017/03/14 18:47) 192.99.4.151
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>
 +
 +===== 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.txt · Last modified: 2020/07/23 08:28 (external edit)