service tweaks

This commit is contained in:
John Lancaster
2025-12-29 01:01:05 -06:00
parent 8000b32cea
commit 0fee09099a

View File

@@ -3,22 +3,18 @@ Description=Certificate renewal
After=network-online.target After=network-online.target
Documentation=https://smallstep.com/docs/step-ca/certificate-authority-server-production Documentation=https://smallstep.com/docs/step-ca/certificate-authority-server-production
StartLimitIntervalSec=0 StartLimitIntervalSec=0
; PartOf=cert-renewer.target
[Service] [Service]
Type=oneshot Type=oneshot
User=root User=root
; ExecCondition checks if the certificate is ready for renewal, ; ExecCondition checks if the certificate is ready for renewal.
; based on the exit status of the command. ; ExecCondition=/usr/bin/step certificate needs-renewal ${CERT_LOCATION}
; (In systemd <242, you can use ExecStartPre= here.)
ExecCondition=/usr/bin/step certificate needs-renewal ${CERT_LOCATION}
; ExecStart renews the certificate, if ExecStartPre was successful. ; ExecStart renews the certificate, if ExecCondition was successful.
ExecStart=/usr/bin/step ca renew --force ${CERT_LOCATION} ${KEY_LOCATION} ExecStart=/usr/bin/step ca renew --force ${CERT_LOCATION} ${KEY_LOCATION}
; ExecStartPost=/usr/bin/openssl x509 -noout -enddate -in ${CERT_LOCATION} ExecStartPost=/usr/bin/openssl x509 -noout -subject -issuer -enddate -in ${CERT_LOCATION}
; ExecStartPost=/usr/bin/docker exec caddy caddy reload --config /etc/caddy/Caddyfile
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target