More descriptive comments
authorsgf <sgf.dma@gmail.com>
Wed, 12 Apr 2023 14:54:36 +0000 (17:54 +0300)
committersgf <sgf.dma@gmail.com>
Wed, 12 Apr 2023 14:54:36 +0000 (17:54 +0300)
systemd/cert_renew.target
systemd/certbot.timer.d/cert_renew.conf
systemd/le_isp_update.service

index a968938..273d41f 100644 (file)
@@ -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
index fc8e5c9..1b39a4b 100644 (file)
@@ -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
index c918cdf..0498855 100644 (file)
@@ -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