acme: remove crontab entry if service is stopped
authorFlorian Eckert <[email protected]>
Fri, 21 Mar 2025 09:41:01 +0000 (10:41 +0100)
committerToke Høiland-Jørgensen <[email protected]>
Tue, 1 Apr 2025 20:53:08 +0000 (22:53 +0200)
Until now it was not possible to stop the acme service, because the handling
was done via cron. With this change, the acme handler can now be stopped by
calling '/etc/init.d/acme' stop. This call removes the entry from the crontab.

Signed-off-by: Florian Eckert <[email protected]>
net/acme-common/files/acme.init

index d35a0a60e6eec24699847e6f81d63cbf2038b4d7..594e320087aeca4700329a35d6521637f719a284 100644 (file)
@@ -150,6 +150,14 @@ service_started() {
        echo "Certificate renewal enabled via cron. To renew now, run '/etc/init.d/acme renew'."
 }
 
+stop_service() {
+       sed -i '\|/etc/init.d/acme|d' /etc/crontabs/root
+}
+
+service_stopped() {
+       echo "Certificate renewal is disabled."
+}
+
 service_triggers() {
        procd_add_config_trigger config.change acme \
                /etc/init.d/acme renew