Gentics Portal | java is also typically started as a systemd service, and the directory structure will look similar to this:
/opt/portal/
config/ (1)
templates/ (2)
queries/ (3)
waitForMesh.sh (4)
portal.jar
1 |
Configuration files for the portal, logging, caching, etc. |
2 |
The Handlebars templates. |
3 |
Project specific GraphQL queries. |
4 |
A script that makes sure Gentics Mesh is available before the portal actually starts. |
In the mentioned setup, this would be the service file for the portal:
portal.service
[Unit]
Description=Gentics Portal java
Wants=basic.target
After=basic.target network.target syslog.target mesh.service (1)
[Service]
User=node
Restart=on-failure
ExecStartPre=./waitForMesh.sh localhost:8080 200 (2)
ExecStart=/usr/bin/java -Xmx512m -jar portal.jar (3)
WorkingDirectory=/opt/portal
LimitMEMLOCK=infinity
LimitNOFILE=65536
LimitAS=infinity
LimitRSS=infinity
LimitCORE=infinity
[Install]
WantedBy=multi-user.target
1 |
The Gentics Mesh service must be started before the portal. |
2 |
Wait up to 200 seconds for Mesh to be available before starting the portal. |
3 |
The actual filename of the portal JAR may vary. |
Both services can then be enabled with the systemctl enable
command:
$ sudo systemctl enable /opt/mesh/mesh.service
$ sudo systemctl enable /opt/portal/portal.service