Below is a report of two problems and solutions.
Running/usr/lib/acme/run-acme gives the error in the log:
Cannot run in standalone mode; another daemon is listening on port 80
It turns out, that the problem is the function
get_listeners()
{
netstat -nptl 2>/dev/null | awk 'match($4, /:80$/){split($7, parts, "/"); print parts[2];}' | uniq | tr "\n" " "
}
pre_checks()
{
main_domain="$1"
log "Running pre checks for $main_domain."
listeners="$(get_listeners)"
debug "port80 listens: $listeners"
case "$listeners" in
"uhttpd")
debug "Found uhttpd listening on port 80; trying to disable."
..
get_listeners() never returns a value that matches "uhttpd" but "uhttpd " - I am unsure, if it should be matched in get_listeners() or in the case-session in pre_checks. I have just removed | tr "\n" " " from get_listeners()
Furthermore if certificate needs renewal and standanlonemode should be used, post_checks() will never be run:
In issue_cert(), Replace
log "Found previous cert config. Issuing renew."
$ACME --home "$STATE_DIR" --renew -d "$main_domain" $acme_args || return 1
return 0
with
log "Found previous cert config. Issuing renew."
$ACME --home "$STATE_DIR" --renew -d "$main_domain" $acme_args
R_CODE=$?
post_checks
return $R_CODE