swiyu-verifier.service (3218B)
1 [Unit] 2 Description=SWIYU Generic Verifier (OpenID4VP credential verification) 3 Documentation=https://docs.taler.net/taler-swiyu-verifier-manual.html 4 Documentation=https://github.com/swiyu-admin-ch/swiyu-verifier 5 After=network-online.target postgresql.service 6 Wants=network-online.target postgresql.service 7 8 [Service] 9 Type=exec 10 User=swiyu-verifier 11 Group=swiyu-verifier 12 13 # The operator's settings, and then the database password, which is optional 14 # ("-") so that the service can be started before swiyu-verifier-dbconfig has 15 # run -- it then fails its own health checks and says why, instead of systemd 16 # refusing to start it with a message about a missing file. 17 # 18 # The signing key is not here: a PEM document has newlines, which an 19 # environment file cannot express, so it is YAML imported by 20 # /etc/swiyu-verifier/application.yml. See swiyu-verifier(1). 21 EnvironmentFile=/etc/swiyu-verifier/swiyu-verifier.env 22 23 # Your settings go here, not in the file above. local.env is read last, so it 24 # overrides it, and -- unlike swiyu-verifier.env, which is a conffile -- the 25 # package never touches it: an upgrade that changes the shipped defaults then 26 # has no conffile question to ask about a file you have edited. Optional, so 27 # a host that edits the conffile anyway still works. 28 EnvironmentFile=-/etc/swiyu-verifier/local.env 29 30 EnvironmentFile=-/etc/swiyu-verifier/secrets/db.env 31 32 # Not "java -jar" directly: the wrapper picks the Java 25 runtime the jar was 33 # built for, adds /etc/swiyu-verifier/application.yml and uses the service's 34 # own truststore if the postinst managed to build one. See swiyu-verifier(1). 35 ExecStart=/usr/bin/swiyu-verifier 36 37 # Where the postinst puts the truststore. The directory is shipped by the 38 # package, so this only keeps it writable for the service. 39 StateDirectory=swiyu-verifier 40 StateDirectoryMode=0750 41 42 # A JVM that catches SIGTERM exits with 143 (128 + 15) rather than dying from 43 # the signal, and systemd counts a non-zero exit code as a failure -- so 44 # without this a plain "systemctl stop" leaves the unit in the failed state, 45 # and the next "start" after a few of those runs into the start limit below. 46 SuccessExitStatus=143 47 48 Restart=always 49 RestartSec=10s 50 # Give up after five failed starts in five minutes rather than restarting for 51 # ever: the usual reason for a failure here is a configuration that cannot 52 # work (no signing key, wrong database), and flapping only hides it. After 53 # fixing it, "systemctl reset-failed swiyu-verifier" clears the limit. 54 StartLimitBurst=5 55 StartLimitInterval=300s 56 57 # A JVM with a cold Spring context and a Flyway migration to run needs longer 58 # than the default 90s on a loaded machine before systemd gives up on it. 59 TimeoutStartSec=300 60 61 StandardOutput=journal 62 StandardError=journal 63 64 PrivateTmp=yes 65 ProtectSystem=strict 66 ProtectHome=yes 67 ProtectClock=yes 68 ProtectHostname=yes 69 ProtectControlGroups=yes 70 ProtectKernelLogs=yes 71 ProtectKernelModules=yes 72 ProtectKernelTunables=yes 73 ProtectProc=invisible 74 PrivateDevices=yes 75 NoNewPrivileges=yes 76 RestrictSUIDSGID=yes 77 RestrictNamespaces=yes 78 LockPersonality=yes 79 # No MemoryDenyWriteExecute: the JVM compiles bytecode at runtime and needs 80 # writable-executable pages for it. 81 82 [Install] 83 WantedBy=multi-user.target