synpse-hq / synpse

Synpse is an all-in-one solution to manage your servers and IoT devices providing declarative app deployment, SSH access and TCP tunnels
https://synpse.com
Apache License 2.0
20 stars 3 forks source link

Agent update prior 0.6.2 #13

Open mjudeikis opened 3 years ago

mjudeikis commented 3 years ago

We use this flow to update the agent:

func() error {
     return syscall.Unlink(u.binaryPath)
},
func() error {
     return os.Rename(b.Name(), u.binaryPath)
},

Os.temp creates tmpfs :

 df -T /tmp/go-build* | awk '{print $2}' | tail -n1
tmpfs

and agent is for sure not on tmpfs:

df -T /usr/local/bin/synpse | awk '{print $2}' | tail -n1                                                                                                                                                                                                                                         
btrfs 

This gives error:

invalid cross-device link

Solution: Move to byte level operation for agent move.

rusenask commented 3 years ago

ah yes, just need to read and write as bytes

mjudeikis commented 3 years ago

:cry: Fix soon will be there.