Repair an installed Linux lifecycle when rerunning its HTTPS installer
This commit is contained in:
@@ -280,6 +280,14 @@ def install(base, token_file):
|
||||
remote((base, token), '/agent/v1/bootstrap/current?platform=' + PLATFORM, metadata)
|
||||
require(read(metadata)['tenant_id'] == config['tenant'], 'different enrollment tenant')
|
||||
save_token(ROOT, token, pwd.getpwnam('rmm-discovery').pw_gid)
|
||||
# An operator rerunning the HTTPS installer can update the lifecycle
|
||||
# harness without replacing the device identity or its stable verifier.
|
||||
with (ROOT / 'release.lock').open('rb') as lock:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX)
|
||||
harness = ROOT / 'lifecycle.py'
|
||||
current = Path(__file__).read_bytes()
|
||||
if harness.read_bytes() != current:
|
||||
save(harness, current)
|
||||
enable()
|
||||
require(healthy(read(ROOT / 'current/manifest.json')['version'], 0), 'awaiting authenticated device heartbeat')
|
||||
service('enable', '--now', TIMER)
|
||||
|
||||
Reference in New Issue
Block a user