From: sgf Date: Wed, 12 Apr 2023 14:54:36 +0000 (+0300) Subject: More descriptive comments X-Git-Url: https://gitweb.sgf-dma.tk/?a=commitdiff_plain;h=b56b412a444f1dd7952c62f816a9fd0b6a548b12;p=le_isp_update.git More descriptive comments --- diff --git a/systemd/cert_renew.target b/systemd/cert_renew.target index a968938..273d41f 100644 --- a/systemd/cert_renew.target +++ b/systemd/cert_renew.target @@ -1,12 +1,19 @@ +# Target for starting several units on single 'certbot.timer'. [Unit] Description=Renew isp certificates -# Uncomment 'WantedBy=cert_renew.target' in 'certbot.service' and -# 'le_isp_update.service' for # this to work. +# Target must become inactive, when all done, otherwise timer won't restart +# it. But default for targets is to remain active. Therefore.. + +# Either use 'StopWhenUnneeded' and uncomment 'WantedBy=cert_renew.target' in +# 'certbot.service' and 'le_isp_update.service'. #StopWhenUnneeded=true # Or use 'BindsTo'. But this requires 'Type=simple' or 'Type=exec' in -# 'le_isp_update.service'. +# 'le_isp_update.service' (binded service), because i need service to become +# 'active'. BindsTo=le_isp_update.service [Install] +# Tie enabling/disabling of 'timer' to enabling/disabling of # units dependent +# on (started by) this target. Also=certbot.service le_isp_update.service diff --git a/systemd/certbot.timer.d/cert_renew.conf b/systemd/certbot.timer.d/cert_renew.conf index fc8e5c9..1b39a4b 100644 --- a/systemd/certbot.timer.d/cert_renew.conf +++ b/systemd/certbot.timer.d/cert_renew.conf @@ -3,7 +3,11 @@ #OnCalendar= #OnCalendar=*-*-* *:*:00 #RandomizedDelaySec=0 + +# Activate a target grouping several units together. Unit=cert_renew.target [Install] +# Tie enabling/disabling of 'timer' to enabling/disabling of units dependent +# on (started by) 'cert_renew.target'. Also=cert_renew.target diff --git a/systemd/le_isp_update.service b/systemd/le_isp_update.service index c918cdf..0498855 100644 --- a/systemd/le_isp_update.service +++ b/systemd/le_isp_update.service @@ -4,6 +4,13 @@ Requires=certbot.service After=certbot.service [Service] +# If i use 'BindsTo=' in target, i need either Type='simple' or 'exec' here +# (in service binded to), because i need that service to become 'active' (so +# target can also become 'active'). 'oneshot' services transition from +# 'activating' directly into 'inactive', unless 'RemainAfterExit=true' is set +# (which is not possible here, because i need this service to become +# 'inactive' eventually, so target also terminates). When i use +# 'StopWhenUnneeded', i may use 'oneshot' though. Type=simple ExecStart=/usr/local/bin/le_isp_update.sh