mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
For safety reason, ctrld will create a backup of the current binary when running upgrade command. However, on systems where ctrld status is got by parsing ps command output, the current binary path is important and must be the same with the original binary. Depends on kernel version, using os.Executable may return new backup binary path, aka "ctrld_previous", not the original "ctrld" binary. This causes upgrade command see ctrld as not running after restart -> upgrade failed. Fixing this by recording the binary path before creating new service, so the ctrld service status can be checked correctly.