I deleted my existing tunnel and created a new one. I have updated the tunnel ID in config.yaml file.
If I hit 'cloudflared tunnel run ', it is working as expected.
I created a script and gave it permissions to executes. Then, I created a service file point to script saying it has to execute everytime on startup.
But, whenever the service starts, it does not work. I get the following output from service status.
Nov 28 16:35:56 cypher systemd: Started cloudflared.service. Nov 28 16:35:56 cypher cloudflared-tunnel.sh: Sleeping for 5 seconds Nov 28 16:36:01 cypher cloudflared-tunnel.sh: Starting Cloudflared Tunnel Nov 28 16:36:03 cypher cloudflared-tunnel.sh: 2021-11-28T16:36:03Z INF Starting tunnel tunnelID=d74c51a9-7f72-4f58-9365-e86a45428ed1 Nov 28 16:36:03 cypher cloudflared-tunnel.sh: Tunnel credentials file '/home/ajitesh/.cloudflared/a89a84c8-0240-4edb-bd97-fba86990ee0d.json' doesn't > Nov 28 16:36:03 cypher systemd: cloudflared.service: Main process exited, code=exited, status=1/FAILURE Nov 28 16:36:03 cypher systemd: cloudflared.service: Failed with result 'exit-code'.
According to output, it knows the new tunnel id, but still it looks for oldtunnelid.json file. I don’t know why.
I have tried replacing tunnels, re-installing cloudflared tunnel etc.
If it is working fine with manual execution, its not working in systemd.
Moreover, I feel like this is a ubuntu or linux issue.
Kindly assist me.