Improve deployment.
[lgpl/argeo-commons.git] / dist / argeo-node / rpm / usr / lib / systemd / system / argeo@.service
index 14c2ecdb3ab9ed1ae6ff01c6013961072bbb6c8d..c2fc366ca69419b364e440b64bd8382a5e9dd30a 100644 (file)
@@ -5,17 +5,26 @@ Wants=postgresql.service
 
 [Service]
 Type=simple
-ExecStart=/usr/sbin/argeoctl start %I
-ExecReload=/usr/sbin/argeoctl reload %I
-DynamicUser=true
 StateDirectory=argeo.d/%I
 LogsDirectory=argeo.d/%I
 ConfigurationDirectory=argeo.d/%I
+CacheDirectory=argeo.d/%I
+WorkingDirectory=/var/lib/argeo.d/%I
 
-# Workaround to pass locations for systemd with version < 240
-Environment=INSTANCE_DIR=/var/lib/argeo.d/%I CONF_DIR=/etc/argeo.d/%I
-#Environment="INSTANCE_DIR=$STATE_DIRECTORY" "CONF_DIR=$CONFIGURATION_DIRECTORY"
-PassEnvironment=INSTANCE_DIR CONF_DIR
+ExecStart=/usr/lib/jvm/jre-11/bin/java \
+  -Dlog4j.configuration="file:/etc/argeo.d/log4j.properties" \
+  -Dosgi.configuration.cascaded=true \
+  -Dosgi.sharedConfiguration.area=/usr/share/argeo \
+  -Dosgi.sharedConfiguration.area.readOnly=true \
+  -Dargeo.node.repo.indexesBase=/var/cache/argeo.d/%I/indexes \
+  @/usr/share/osgi/boot/framework.args \
+  @/etc/argeo.d/jvm.args \
+  @/etc/argeo.d/%I/jvm.args \
+  -configuration /var/lib/argeo.d/%I/state \
+  -data /var/lib/argeo.d/%I/data
+#ExecReload=/usr/sbin/argeoctl reload %I
+# Exit codes of the JVM when SIGTERM or SIGINT have been caught:
+SuccessExitStatus=143 130
 
 [Install]
 WantedBy=multi-user.target