Skip to content

Commit

Permalink
Merge pull request #1128 from ItzMiracleOwO/master
Browse files Browse the repository at this point in the history
Fix service fail to start due to network not ready on boot
  • Loading branch information
chungthuang authored Mar 5, 2024
2 parents bbc6411 + ee961ce commit 01f0353
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/cloudflared/linux_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ var systemdAllTemplates = map[string]ServiceTemplate{
Path: fmt.Sprintf("/etc/systemd/system/%s", cloudflaredService),
Content: `[Unit]
Description=cloudflared
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
TimeoutStartSec=0
Expand All @@ -72,7 +73,8 @@ WantedBy=multi-user.target
Path: fmt.Sprintf("/etc/systemd/system/%s", cloudflaredUpdateService),
Content: `[Unit]
Description=Update cloudflared
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/bin/bash -c '{{ .Path }} update; code=$?; if [ $code -eq 11 ]; then systemctl restart cloudflared; exit 0; fi; exit $code'
Expand Down

0 comments on commit 01f0353

Please sign in to comment.