Make new systemd units more robust.
[lgpl/argeo-commons.git] / dist / argeo-node / rpm / usr / lib / systemd / system / argeo@.service
index d76f7424a0ea76e30e9a3670d96c5bb73e4c5a18..14c2ecdb3ab9ed1ae6ff01c6013961072bbb6c8d 100644 (file)
@@ -1,18 +1,21 @@
 [Unit]
-Description=Argeo Node %I
+Description=Argeo node %I
 After=network.target
 Wants=postgresql.service
 
 [Service]
 Type=simple
-PIDFile=/var/run/argeo/%i.pid
 ExecStart=/usr/sbin/argeoctl start %I
 ExecReload=/usr/sbin/argeoctl reload %I
-SuccessExitStatus=143
 DynamicUser=true
 StateDirectory=argeo.d/%I
 LogsDirectory=argeo.d/%I
 ConfigurationDirectory=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
+
 [Install]
 WantedBy=multi-user.target