+# 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
#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
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