diff --git a/README.md b/README.md index 2c358d8..1830f82 100644 --- a/README.md +++ b/README.md @@ -51,5 +51,8 @@ the user service before. systemctl --user link /usr/lib/systemd/system/network-online.target ``` -This would make `network-online.target` available after a _reboot_ to the user -who issued the command. \ No newline at end of file +This would make `network-online.target` available after a _reboot_ to the user who issued the command. + +### `network-online.target` doesn't recognize DNS correctly + +If you like to set `Persistent=true`, then you should probably equip the related `.service` file with a `ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done'` or any domain you think is 100% reachable. \ No newline at end of file diff --git a/etc/systemd/user/borgmatic-check@.service b/etc/systemd/user/borgmatic-check@.service index c9c8ae0..fe8f00e 100644 --- a/etc/systemd/user/borgmatic-check@.service +++ b/etc/systemd/user/borgmatic-check@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=borgmatic check --only repository --only archives --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/borgmatic-create@.service b/etc/systemd/user/borgmatic-create@.service index 27b3e31..bc013e0 100644 --- a/etc/systemd/user/borgmatic-create@.service +++ b/etc/systemd/user/borgmatic-create@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=borgmatic create --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/borgmatic-prune@.service b/etc/systemd/user/borgmatic-prune@.service index 1d164f9..c2be5c0 100644 --- a/etc/systemd/user/borgmatic-prune@.service +++ b/etc/systemd/user/borgmatic-prune@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=borgmatic prune --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/borgmatic@.service b/etc/systemd/user/borgmatic@.service index 7088c8f..1d485fa 100644 --- a/etc/systemd/user/borgmatic@.service +++ b/etc/systemd/user/borgmatic@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=borgmatic --syslog-verbosity 1 --config %h/.config/borgmatic/%I.yml Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/check_updates.service b/etc/systemd/user/check_updates.service index d60face..ac98c7c 100644 --- a/etc/systemd/user/check_updates.service +++ b/etc/systemd/user/check_updates.service @@ -1,9 +1,13 @@ [Unit] Description=Run check_updates OnFailure=systemd_failure_notify@%n.service +Wants=network-online.target +After=network-online.target +Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=check_updates [Install] diff --git a/etc/systemd/user/restic-check@.service b/etc/systemd/user/restic-check@.service index 809299d..fcaa3ca 100644 --- a/etc/systemd/user/restic-check@.service +++ b/etc/systemd/user/restic-check@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=sh %h/.config/restic/%I/check.sh Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/restic-create@.service b/etc/systemd/user/restic-create@.service index b831b53..5e1cfd9 100644 --- a/etc/systemd/user/restic-create@.service +++ b/etc/systemd/user/restic-create@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=sh %h/.config/restic/%I/create.sh Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/restic-prune@.service b/etc/systemd/user/restic-prune@.service index 7b6ac9f..915bb95 100644 --- a/etc/systemd/user/restic-prune@.service +++ b/etc/systemd/user/restic-prune@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=sh %h/.config/restic/%I/prune.sh Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh" diff --git a/etc/systemd/user/restic-report@.service b/etc/systemd/user/restic-report@.service index 5a72e16..62f1024 100644 --- a/etc/systemd/user/restic-report@.service +++ b/etc/systemd/user/restic-report@.service @@ -7,6 +7,7 @@ Requires=network-online.target [Service] Type=oneshot +#ExecStartPre=/bin/bash -c 'until host captiveportal.myservermanager.com; do sleep 1; done' ExecStart=sh %h/.config/restic/%I/report.sh Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin" Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"