diff --git a/scripts/packaging/template.service b/scripts/packaging/template.service index c0f5a52..5e35365 100644 --- a/scripts/packaging/template.service +++ b/scripts/packaging/template.service @@ -1,6 +1,7 @@ [Unit] Description=Ghost Node -After=network.target +After=network-online.target +Requires=network-online.target Documentation=https://git.ghostchain.io/ghostchain/ghost-node [Service] diff --git a/scripts/patches/patch-1.sh b/scripts/patches/patch-1.sh index 6b820de..8a28e85 100755 --- a/scripts/patches/patch-1.sh +++ b/scripts/patches/patch-1.sh @@ -14,7 +14,7 @@ check_unit_file_validity() { if [[ -z "$NETWORK_ONLINE_EXISTS" && -n "$NETWORK_EXISTS" ]] then echo "[-] WARNING: missing network-online.target dependency in $SERVICE_FULL_PATH, trying to replace" - sudo sed -i 's/After=network.target/After=network-online.target/g' "$SERVICE_FULL_PATH" + sudo sed -i "s/After=network.target/After=network-online.target\nRequires=network-online.target/g" "$SERVICE_FULL_PATH" else echo "[+] INFO: network-online.target is set correctly for $SERVICE_FULL_PATH" fi