lego: renewal hook hangs forever

Welcome

  • Yes, I’m using a binary release within 2 latest releases.
  • Yes, I’ve searched similar issues on GitHub and didn’t find any.
  • Yes, I’ve included all information below (version, config, etc).

What did you expect to see?

I expect lego to exit after executing my post renewal hook

What did you see instead?

lego just hangs forever after executing the entire hook

How do you use lego?

Binary

Reproduction steps

everything in this script gets executed properly. the service comes back up and the final “EVERYTHING DONE” line shows up in the test log. the lego command never exits, however, if I define a renew-hook.

# Create the fullchain
# ACME LEAF CERTS ALREADY CONTAIN CHAIN UP TO INTERMEDIATE
cat "$CERT_FILE" "$ROOT_CERT" > "$FULLCHAIN"

# Create the PKCS12 file
openssl pkcs12 -export -in "$FULLCHAIN" -inkey "$KEY_FILE" -out "$PKCS12_FILE" -name shared -password pass:$JKS_PASSWORD

# Convert PKCS12 to JKS format
keytool -importkeystore -srckeystore "$PKCS12_FILE" -srcstoretype PKCS12 -destkeystore "$JKS_FILE" -deststoretype JKS -srcstorepass "$JKS_PASSWORD" -deststorepass "$JKS_PASSWORD" -noprompt

# Clean up PKCS12 file
#rm "$PKCS12_FILE"

echo "JKS keystore created at $JKS_FILE" >> /home/b1admin/test.log
/home/b1admin/wf_stop.sh >> /home/b1admin/test.log
#sleep 5 &&
/home/b1admin/wf_startup.sh >> /home/b1admin/test.log
echo "EVERYTHING DONE" >> /home/b1admin/test.log
exit 0

Effective version of lego

lego version v4.22.2+dev-detach linux/amd64

Logs

server responded with a certificate, then nothing

Go environment (if applicable)

$ go version && go env
# paste output here

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

I will open a PR in a few minutes 😉

ok I’ve been discussing this with my chatbot, and its definitely my fault. the reason seems to be that wf_startup launches an apache tomcat process which is configured not to properly daemonize for tomcat reasons, and it needs to be executed with nohup and disown. probably if I detach and disown the wf_startup process then everything will work. will update when I get back to work tomorrow.