Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Archived Page

This page has been archived. The information on this page may not be up-to-date or maintained.

These are the steps to follow for making the OpenMRS launch automatically. We want our server to start automatically, so it starts  after booting the pc and when is network available.


Sript for launching the openmrs server:

 
#!/bin/bash cd /home/pere/Documents/referenceapplication-standalone-2.7.0/ 
 java -jar openmrs-standalone.jar -commandline -tomcatport 8081

Number of port used by tomcat is arbitrary


We have to save it in:/usr/local/bin/


Now, create a file called: /lib/system/system/OpenMRS.service


It has to contain:


[Unit]
 Description=Launch OpenMRS server service
 After=network.target
 StartLimitIntervalSec=0
 [Service] Type=simple
 RestartSec=1
 User=pere
 ExecStart=/usr/local/bin/launchServer.sh
 [Install] WantedBy=multi-user.target

Where User= field contains the user’s session name and ExecStart = the path to run the script.




Now, start the service:


$ sudo systemctl start OpenMRS


And start on boot:


$ sudo systemctl enable OpenMRS



For checking the status of the service:


$ systemctl status OpenMRS.service


  • No labels