Record preserved Linux helper followup and explicit journal capacity blocker
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -19,8 +19,8 @@ import uuid
|
||||
import linux_updater_bootstrap as prerequisite
|
||||
import remote_client_bootstrap as transport
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
BASE=ROOT/'devstate/linux-updater-capability-build/9923a97f-4c8c-4e0a-bbad-4f1d88f0d43a/manifest.json'
|
||||
BASE_SHA='a41ad700b4b7527bf911bf00f2745914188760c631af0c3255364c05f1ef4fbc'
|
||||
BASE=ROOT/'devstate/linux-updater-helper-start-build/d674db1c-ebca-48ed-b04c-8f7ec9e45ca1/manifest.json'
|
||||
BASE_SHA='3520d0cfdda856b2c9c075197059047e47a24dab42270f4676416dd1ec5871cf'
|
||||
BOOT='45aba743-be1d-4ae5-ba00-139fb9363bfe'
|
||||
|
||||
def sha(raw):return hashlib.sha256(raw).hexdigest()
|
||||
@@ -127,6 +127,13 @@ def pair(payload):
|
||||
def status(unit):
|
||||
fields={k:v for k,v in(line.split('=',1)for line in run(['systemctl','show','--all','--property=Id,ActiveState,SubState,MainPID,ControlPID,InvocationID,Job,ControlGroup,UnitFileState','--',unit]).splitlines())};require(fields['Id']==unit,'exact service');return fields
|
||||
units=['rmm-agent-remote.service','rmm-helper-cloud.service','rmm-full-maintenance-helper.service']
|
||||
def closed_service(unit,row):
|
||||
empty=row['MainPID']=='0'and row['ControlPID']=='0'and not row['Job']and not row['ControlGroup']
|
||||
if row['ActiveState']=='inactive':return empty
|
||||
if row['ActiveState']!='failed'or unit!=units[2]or manifest.get('followup_of_case_id')!='ac6cf439-e0a6-4323-82e1-c55df96b2441':return False
|
||||
original=json.loads((Path('/var/lib/rmm-updater-bootstrap/ac6cf439-e0a6-4323-82e1-c55df96b2441')/'pair-started.json').read_text())['status'][unit]
|
||||
failure=dict(line.split('=',1)for line in run(['systemctl','show','--property=Result,ExecMainCode,ExecMainStatus,NRestarts,Restart','--',unit]).splitlines())
|
||||
return empty and row['InvocationID']==original['InvocationID']and failure=={'Result':'exit-code','ExecMainCode':'1','ExecMainStatus':'1','NRestarts':'0','Restart':'no'}
|
||||
def databases():
|
||||
result={}
|
||||
for path in ('/var/lib/rmm-agent-remote/journal.sqlite','/var/lib/rmm-agent-remote/consumption.sqlite','/var/lib/rmm-helper/consumption.sqlite'):
|
||||
@@ -155,29 +162,56 @@ def pair(payload):
|
||||
for name,entry in manifest['files'].items():require(sha((folder/name).read_bytes())==entry['sha256'],'staged artifact changed')
|
||||
for unit in ('rmm-apt-helper.service','rmm-agent.service','rmm-helper-dev-test.service'):
|
||||
s=status(unit);require(s['ActiveState']=='inactive'and s['MainPID']in('','0')and s['ControlPID']in('','0')and s['Job']==''and s['UnitFileState']in('','disabled'),'APT and legacy remain closed')
|
||||
if payload['action']=='install':
|
||||
require(not(folder/'pair-install-intent.json').exists(),'existing intent means readback, never repeat')
|
||||
transitions=[('agent.bin','/usr/local/libexec/rmm-agent-remote',manifest['old_agent_sha256']),('helper.bin','/usr/local/libexec/rmm-privileged-helper',manifest['old_helper_sha256']),('full-config.json','/etc/rmm-remote/helper-full-maintenance.json',manifest['old_config_sha256']),('full-pin.json','/etc/rmm-remote/full-maintenance-helper-proof.json',manifest['old_pin_sha256'])]
|
||||
followup=payload['action']in('install-followup','install-stopped-followup');continuing=payload['action']=='install-stopped-followup'
|
||||
if payload['action']=='validate-staged':
|
||||
result=subprocess.check_output([str(folder/'helper.bin'),'--inspect-full-maintenance-profile'],env={'RMM_HELPER_CONFIG':str(folder/'full-config.json'),'PATH':'/usr/bin:/bin'},stderr=subprocess.DEVNULL,timeout=20);pin=json.loads(result)
|
||||
require(pin==json.loads((folder/'full-pin.json').read_text())and pin['helper_binary_sha256']==manifest['files']['helper.bin']['sha256'],'actual staged helper independently reproduces exact Full pin')
|
||||
record('staged-profile-qualified.json',{'actual_helper_sha256':pin['helper_binary_sha256'],'actual_full_policy_sha256':pin['policy_sha256'],'profile_matches':True,'services_changed':False,'job_authority':False})
|
||||
return {'case_id':ident,'actual_native_staged_profile_matches':True,'full_policy_sha256':pin['policy_sha256'],'services_changed':False,'job_authority':False}
|
||||
elif payload['action']in('install','install-followup','install-stopped-followup'):
|
||||
if continuing:require(ident=='8fa5c0bd-b0ae-45ec-8cde-3d766d0576d4'and(folder/'pair-install-intent.json').is_file()and not(folder/'pair-followup-continue-intent.json').exists(),'exact known stopped pre-swap followup only')
|
||||
else:require(not(folder/'pair-install-intent.json').exists(),'existing intent means readback, never repeat')
|
||||
fence=payload['central_fence'];require(fence['operation']=='linux_compatible_closed_scope_v1'and fence['open_jobs']==0 and not fence['job_authority']and fence['tenant_id']==manifest['tenant_id']and fence['agent_id']==manifest['agent_id'],'closed central scope')
|
||||
at=datetime.datetime.fromisoformat(fence['observed_at']);require(0<=(datetime.datetime.now(datetime.timezone.utc)-at).total_seconds()<30,'fresh closed-scope readback')
|
||||
before={u:status(u)for u in units};pids=[]
|
||||
if followup:
|
||||
require((folder/'staged-profile-qualified.json').is_file(),'actual native staged Full profile qualification required')
|
||||
require(manifest.get('followup_of_case_id')=='ac6cf439-e0a6-4323-82e1-c55df96b2441'and manifest['files']['agent.bin']['sha256']==manifest['old_agent_sha256']=='7fef8d0f1e2bcf5cd6c373e567a0c17bfb08d8c780cd4d1925b6c1355e572547'and manifest['old_helper_sha256']=='8fdc6ded02278eb18e64003d0bc7bf45d452cd48ded0450e6e900ca66e44d449','exact known failed baseline followup only')
|
||||
failure=dict(line.split('=',1)for line in run(['systemctl','show','--property=Result,ExecMainCode,ExecMainStatus,NRestarts,Restart','--',units[2]]).splitlines());require(failure=={'Result':'exit-code','ExecMainCode':'1','ExecMainStatus':'1','NRestarts':'0','Restart':'no'},'known original failed no-restart Full startup')
|
||||
require(before[units[2]]['ActiveState']=='failed'and before[units[2]]['MainPID']=='0'and before[units[2]]['ControlPID']=='0'and not before[units[2]]['Job'],'closed original failed Full')
|
||||
require(not Path('/etc/rmm-agent-updater/policy.json').exists()and not Path('/var/lib/rmm-agent-updater/installed-record.json').exists()and status('rmm-agent-updater.service')['ActiveState']=='inactive','no trust or update activity before compatible followup')
|
||||
require(sha(Path('/usr/local/libexec/rmm-agent-remote').read_bytes())==manifest['old_agent_sha256'],'unchanged exact V2Agent');transitions=transitions[1:]
|
||||
for u,s in before.items():
|
||||
if continuing:
|
||||
require(closed_service(u,s),'known fully closed original stop');continue
|
||||
if followup and u==units[2]:continue
|
||||
require(s['ActiveState']=='active'and int(s['MainPID'])>1 and s['ControlPID']=='0'and s['Job']=='','exact active original pair')
|
||||
pid=int(s['MainPID']);fd=os.pidfd_open(pid);pids.append(fd)
|
||||
original=databases();retained=retained_metadata()
|
||||
for source,target,oldsha in [('agent.bin','/usr/local/libexec/rmm-agent-remote',manifest['old_agent_sha256']),('helper.bin','/usr/local/libexec/rmm-privileged-helper',manifest['old_helper_sha256']),('full-config.json','/etc/rmm-remote/helper-full-maintenance.json',manifest['old_config_sha256']),('full-pin.json','/etc/rmm-remote/full-maintenance-helper-proof.json',manifest['old_pin_sha256'])]:
|
||||
if continuing:
|
||||
original_intent=json.loads((folder/'pair-install-intent.json').read_text());require(original_intent['files']==manifest['files']and original_intent['known_full_failure']==failure,'exact original admission and known failure')
|
||||
for u,s in before.items():
|
||||
old=original_intent['before'][u];require(old['InvocationID']==s['InvocationID']and(old['MainPID']=='0'or not Path('/proc/'+old['MainPID']).exists()),'original service invocation retained and original PID exited')
|
||||
original=original_intent['databases'];retained=original_intent['retained'];require(retained_metadata()==retained,'original pre-stop identity PKI General metadata retained')
|
||||
for source,target,oldsha in transitions:
|
||||
path=Path(target);require(not(folder/(source+'-save-intent.json')).exists()and not(folder/(source+'-publish-intent.json')).exists()and not path.with_name(path.name+'.bootstrap-'+ident+'.previous').exists()and not path.with_name(path.name+'.bootstrap-'+ident+'.candidate').exists(),'zero original swap intents or renames, never resume ambiguous effects')
|
||||
else:original=databases();retained=retained_metadata()
|
||||
for source,target,oldsha in transitions:
|
||||
raw,_=public(target,256*1024*1024);require(sha(raw)==oldsha,'original target CAS')
|
||||
record('pair-install-intent.json',{'before':before,'databases':original,'retained':retained,'central_fence':fence,'files':manifest['files']})
|
||||
run(['systemctl','stop','--',units[0],units[2],units[1]],30)
|
||||
if continuing:record('pair-followup-continue-intent.json',{'before':before,'original_stop_sha256':sha((folder/'pair-install-intent.json').read_bytes()),'central_fence':fence,'stop_repeated':False,'job_authority':False})
|
||||
else:
|
||||
record('pair-install-intent.json',{'before':before,'databases':original,'retained':retained,'central_fence':fence,'files':manifest['files'],'known_full_failure':failure if followup else None})
|
||||
run(['systemctl','stop','--',units[0],units[2],units[1]],30)
|
||||
for fd in pids:
|
||||
poll=select.poll();poll.register(fd,select.POLLIN);require(poll.poll(1000),'original process not exited');os.close(fd)
|
||||
for u in units:
|
||||
s=status(u);require(s['ActiveState']=='inactive'and s['MainPID']=='0'and s['ControlPID']=='0'and not s['Job']and not s['ControlGroup'],'all original processes stopped')
|
||||
s=status(u);require(closed_service(u,s),'all original processes stopped or exact preserved original Full failure')
|
||||
with contextlib.ExitStack()as held:
|
||||
for path in ('/var/lib/rmm-agent-remote/agent.lock','/var/lib/rmm-helper/executor.lock'):
|
||||
f=held.enter_context(open(path,'rb'));fcntl.flock(f,fcntl.LOCK_EX|fcntl.LOCK_NB)
|
||||
closed=databases()
|
||||
require(all(closed[p]['file_id']==v['file_id']and closed[p]['evidence_sha256']==v['evidence_sha256']for p,v in original.items()),'original effect history changed during stop')
|
||||
for source,target,oldsha in [('agent.bin','/usr/local/libexec/rmm-agent-remote',manifest['old_agent_sha256']),('helper.bin','/usr/local/libexec/rmm-privileged-helper',manifest['old_helper_sha256']),('full-config.json','/etc/rmm-remote/helper-full-maintenance.json',manifest['old_config_sha256']),('full-pin.json','/etc/rmm-remote/full-maintenance-helper-proof.json',manifest['old_pin_sha256'])]:
|
||||
for source,target,oldsha in transitions:
|
||||
target=Path(target);old,meta=public(target,256*1024*1024);require(sha(old)==oldsha,'stopped target CAS')
|
||||
previous=target.with_name(target.name+'.bootstrap-'+ident+'.previous');candidate=target.with_name(target.name+'.bootstrap-'+ident+'.candidate');require(not previous.exists()and not candidate.exists(),'create-once bootstrap names')
|
||||
fd=os.open(candidate,os.O_WRONLY|os.O_CREAT|os.O_EXCL|os.O_NOFOLLOW,stat.S_IMODE(meta.st_mode))
|
||||
@@ -216,14 +250,54 @@ def pair(payload):
|
||||
updater=status('rmm-agent-updater.service');require(updater['ActiveState']=='inactive'and updater['MainPID']=='0'and updater['ControlPID']=='0'and not updater['Job']and updater['UnitFileState']=='disabled','updater remains stopped and disabled')
|
||||
record('units-installed.json',{'updater':updater,'restart_override_sha256':sha(override.read_bytes()),'namespace_provisioned':True,'updater_started':False})
|
||||
return {'case_id':ident,'updater_unit_installed_not_started':True,'full_restart_no_bound':True,'job_authority':False}
|
||||
elif payload['action']=='adopt-units':
|
||||
require(manifest.get('followup_of_case_id')=='ac6cf439-e0a6-4323-82e1-c55df96b2441'and(folder/'pair-installed.json').is_file(),'exact known baseline followup')
|
||||
require(not(folder/'units-installed.json').exists(),'create-only adopted unit receipt')
|
||||
require(sha(Path('/usr/local/libexec/rmm-agent-updater').read_bytes())==manifest['files']['updater.bin']['sha256']and Path('/etc/systemd/system/rmm-agent-updater.service').read_bytes()==(folder/'updater.service').read_bytes(),'exact previously installed stable updater unit and bytes')
|
||||
require(Path('/etc/systemd/system/rmm-full-maintenance-helper.service.d/99-rmm-update-closed-start.conf').read_bytes()==b'[Service]\nRestart=no\n'and run(['systemctl','show','--value','--property=Restart','--',units[2]])=='no','original closed restart override')
|
||||
for u in units+['rmm-agent-updater.service']:
|
||||
s=status(u);require(closed_service(u,s),'all project roles remain closed before followup start')
|
||||
record('units-installed.json',{'adopted_unchanged_from':manifest['followup_of_case_id'],'updater_started':False,'job_authority':False})
|
||||
return {'case_id':ident,'existing_units_adopted_unchanged':True,'updater_started':False,'job_authority':False}
|
||||
elif payload['action']=='start':
|
||||
installed=json.loads((folder/'pair-installed.json').read_text());require((folder/'units-installed.json').is_file(),'separate reviewed unit setup required');require(not(folder/'pair-start-intent.json').exists(),'existing start means readback only')
|
||||
require(retained_metadata()==installed['retained'],'original metadata changed')
|
||||
for u in units:
|
||||
s=status(u);require(s['ActiveState']=='inactive'and s['MainPID']=='0'and s['ControlPID']=='0'and not s['Job'],'pair remains stopped')
|
||||
s=status(u);require(closed_service(u,s),'pair remains stopped or original known Full failure preserved')
|
||||
record('pair-start-intent.json',{'units':[units[1],units[2],units[0]],'only_once':True})
|
||||
for u in (units[1],units[2],units[0]):
|
||||
record(u+'-start-intent.json',{'unit':u});run(['systemctl','start','--',u],20);s=status(u);require(s['ActiveState']=='active'and int(s['MainPID'])>1,'single compatible start')
|
||||
if u==units[1]:
|
||||
# A real nonmutating Policy nonce as the provisioned UID proves General
|
||||
# finished initialization before Full is started. No snapshot/apply/job.
|
||||
import socket,struct
|
||||
pin=json.loads(Path('/etc/rmm-remote/general-helper-proof.json').read_text());challenge=str(uuid.uuid4());request={'operation':'general_policy_v1','challenge':challenge,'identity':pin['identity']};wire=json.dumps(request,separators=(',',':')).encode();expected_pid=int(s['MainPID']);ledger_id=identity('/var/lib/rmm-helper/consumption.sqlite');lock_id=identity('/var/lib/rmm-helper/executor.lock')
|
||||
read_fd,write_fd=os.pipe();child=os.fork()
|
||||
if child==0:
|
||||
os.close(read_fd)
|
||||
try:
|
||||
os.setgroups([]);os.setgid(984);os.setuid(993);deadline=time.monotonic()+10;answer=None
|
||||
while time.monotonic()<deadline:
|
||||
try:
|
||||
with socket.socket(socket.AF_UNIX,socket.SOCK_STREAM)as connection:
|
||||
connection.settimeout(1);connection.connect('/run/rmm-helper-cloud/control.sock');peer=struct.unpack('3i',connection.getsockopt(socket.SOL_SOCKET,socket.SO_PEERCRED,12));require(peer==(expected_pid,0,984),'actual Root General server peer')
|
||||
connection.sendall(len(wire).to_bytes(4,'big')+wire)
|
||||
def receive(count):
|
||||
out=b''
|
||||
while len(out)<count:
|
||||
part=connection.recv(count-len(out));require(bool(part),'complete actual General response');out+=part
|
||||
return out
|
||||
count=int.from_bytes(receive(4),'big');require(0<count<=65536,'bounded actual General response');response=json.loads(receive(count));policy=response['policy']
|
||||
require(response['schema_version']==1 and response['challenge']==challenge and response['identity']==pin['identity']and response['profile']=='general'and response['policy_sha256']==pin['policy_sha256']==sha(json.dumps(policy,separators=(',',':'),ensure_ascii=False).encode())and policy['identity']==pin['identity']and response['snapshot']is None and not response['unlocked_grants'],'exact nonce policy only, no lease')
|
||||
require([response['ledger_device'],response['ledger_inode']]==ledger_id[:2]and[response['lock_device'],response['lock_inode']]==lock_id[:2],'actual original shared ledger and lock')
|
||||
answer={'authenticated_general_nonce':True,'peer_pid':expected_pid,'policy_sha256':response['policy_sha256'],'job_authority':False};break
|
||||
except(FileNotFoundError,ConnectionRefusedError,socket.timeout):time.sleep(.02)
|
||||
require(answer is not None,'bounded General initialization deadline');os.write(write_fd,json.dumps(answer).encode());os._exit(0)
|
||||
except Exception:os.write(write_fd,b'{"authenticated_general_nonce":false}');os._exit(1)
|
||||
os.close(write_fd)
|
||||
try:
|
||||
require(bool(select.select([read_fd],[],[],12)[0]),'bounded owned child General barrier');raw=os.read(read_fd,16384);_,code=os.waitpid(child,0);require(code==0,'actual General authenticated initialization barrier failed');barrier=json.loads(raw);require(barrier['authenticated_general_nonce']and status(u)==s,'same actual General process after nonce');record('general-initialization-barrier.json',barrier)
|
||||
finally:os.close(read_fd)
|
||||
record('pair-started.json',{'status':{u:status(u)for u in units},'job_authority':False})
|
||||
return {'case_id':ident,'compatible_services_started_once':True,'job_authority':False,'normal_signed_sync_qualification_still_required':True}
|
||||
elif payload['action']=='qualify':
|
||||
@@ -324,13 +398,16 @@ def pair(payload):
|
||||
return {'case_id':ident,'records':names,'public_evidence':public,'status':{u:status(u)for u in units+['rmm-agent-updater.service']},'databases':databases(),'job_authority':False}
|
||||
else:raise RuntimeError('unknown fixed pair action')
|
||||
|
||||
def prepare(sdk_manifest):
|
||||
def prepare(sdk_manifest,prior_package=None):
|
||||
require=lambda ok,msg:None if ok else(_ for _ in()).throw(RuntimeError(msg))
|
||||
require(sha(BASE.read_bytes())==BASE_SHA,'exact capability derivative V2 manifest')
|
||||
build=json.loads(BASE.read_text());sdk=json.loads(sdk_manifest.read_text());require(sdk['profile']=='linux_updater_bootstrap_metadata_sdk_v1'and sdk['release_built']and sdk['clippy_all_targets_passed']and not sdk['target_mutated'],'sealed metadata SDK')
|
||||
inputs=native_rpc(public_inputs,{'operation':'linux_compatible_public_inputs_v1'})
|
||||
snapshot=transport.rpc('linux-vm.conf',prerequisite.inspect_vm,{'operation':'linux_updater_bootstrap_inspect_v1'})
|
||||
require(snapshot['boot_id']==BOOT and not snapshot['updater_provisioned'],'original initial target')
|
||||
require(snapshot['boot_id']==BOOT,'original target boot')
|
||||
if prior_package is None:require(not snapshot['updater_provisioned'],'original initial target')
|
||||
else:
|
||||
prior=json.loads(prior_package.read_text());require(prior['case_id']=='ac6cf439-e0a6-4323-82e1-c55df96b2441'and not snapshot['updater_provisioned']and snapshot['binaries']['/usr/local/libexec/rmm-agent-updater']['sha256']==build['stable_updater']['sha256']and snapshot['units']['rmm-agent-updater.service']['status']['ActiveState']=='inactive'and snapshot['units']['rmm-agent-updater.service']['status']['LoadState']=='loaded'and snapshot['units']['rmm-full-maintenance-helper.service']['status']['ActiveState']=='failed','exact previously installed but unprovisioned updater and known original failed Full')
|
||||
full=json.loads(bytes(inputs['helper-full-maintenance.json']['bytes']));key=json.loads(bytes(inputs['helper-signing-key.json']['bytes']))
|
||||
require(full['signing_key_file']=='/etc/rmm-remote/helper-signing-key.json','independent fixed Full keyfile')
|
||||
binary=Path(sdk['binary']['path']);require(sha(binary.read_bytes())==sdk['binary']['sha256'],'sealed SDK bytes')
|
||||
@@ -346,15 +423,16 @@ def prepare(sdk_manifest):
|
||||
proof=transition['proof'];require(proof['new_helper_sha256']==build['artifacts']['source0']['helper']['sha256']and proof['old_config_sha256']==inputs['helper-full-maintenance.json']['sha256']and proof['old_pin_sha256']==inputs['full-maintenance-helper-proof.json']['sha256'],'typed exact Full transition')
|
||||
for name,raw in files.items():once(folder/name,raw)
|
||||
binding=full['binding'];payload={'schema_version':1,'profile':'linux_compatible_bootstrap_package_v1','case_id':ident,'boot_id':BOOT,'tenant_id':binding['tenant_id'],'agent_id':binding['agent_id'],'asset_id':binding['asset_id'],'enrollment_generation':binding['enrollment_generation'],'assignment_version':binding['assignment_version'],'build_manifest_sha256':BASE_SHA,'sdk_manifest_sha256':sha(sdk_manifest.read_bytes()),'old_agent_sha256':snapshot['binaries']['/usr/local/libexec/rmm-agent-remote']['sha256'],'old_helper_sha256':snapshot['binaries']['/usr/local/libexec/rmm-privileged-helper']['sha256'],'old_config_sha256':proof['old_config_sha256'],'old_pin_sha256':proof['old_pin_sha256'],'full_transition':proof,'files':{n:{'sha256':sha(raw),'bytes':len(raw),'base64':base64.b64encode(raw).decode()}for n,raw in files.items()},'job_authority':False}
|
||||
if prior_package is not None:payload['followup_of_case_id']=prior['case_id']
|
||||
once(folder/'package.json',json.dumps(payload,sort_keys=True,separators=(',',':')).encode());once(folder/'readonly-before.json',json.dumps(snapshot,sort_keys=True,indent=2).encode());once(folder/'public-inputs.json',json.dumps(inputs,sort_keys=True,indent=2).encode())
|
||||
summary={k:v for k,v in payload.items()if k!='files'};summary['files']={n:{k:v for k,v in e.items()if k!='base64'}for n,e in payload['files'].items()};once(folder/'manifest.json',json.dumps(summary,sort_keys=True,indent=2).encode())
|
||||
print(json.dumps({'package':str(folder/'package.json'),'manifest':str(folder/'manifest.json'),'case_id':ident,'local_only_preparation':True,'target_staged':False,'services_changed':False,'full_policy_sha256':proof['new_policy_sha256']}))
|
||||
|
||||
def main():
|
||||
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('action',choices=('prepare','public-inputs','central-check','stage','install','units','start','qualify','registry','trust','updater-start','passive-check','readback'));parser.add_argument('--package',type=Path);parser.add_argument('--sdk-manifest',type=Path);parser.add_argument('--trust-package',type=Path);args=parser.parse_args()
|
||||
parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('action',choices=('prepare','public-inputs','central-check','stage','validate-staged','install','install-followup','install-stopped-followup','units','adopt-units','start','qualify','registry','trust','updater-start','passive-check','readback'));parser.add_argument('--package',type=Path);parser.add_argument('--sdk-manifest',type=Path);parser.add_argument('--trust-package',type=Path);parser.add_argument('--prior-package',type=Path);args=parser.parse_args()
|
||||
if args.action=='prepare':
|
||||
if args.sdk_manifest is None:parser.error('--sdk-manifest required for preparation')
|
||||
prepare(args.sdk_manifest);return
|
||||
prepare(args.sdk_manifest,args.prior_package);return
|
||||
if args.package is None:parser.error('--package required for fixed native phases')
|
||||
p=json.loads(args.package.read_text());require=lambda ok,msg:None if ok else(_ for _ in()).throw(RuntimeError(msg))
|
||||
require(p['schema_version']==1 and p['profile']=='linux_compatible_bootstrap_package_v1'and p['boot_id']==BOOT,'reviewed exact package')
|
||||
@@ -366,7 +444,7 @@ def main():
|
||||
trust=json.loads(args.trust_package.read_text());files=trust['files'];value=native_rpc(passive_check,{'tenant_id':p['tenant_id'],'agent_id':p['agent_id'],'record_sha256':files['installed-record.json']['sha256'],'policy_sha256':files['policy.json']['sha256'],'keyring_sha256':files['keyring.json']['sha256'],'health_pin_sha256':files['health-key.json']['sha256'],'agent_sha256':p['files']['agent.bin']['sha256'],'helper_sha256':p['files']['helper.bin']['sha256'],'updater_sha256':p['files']['updater.bin']['sha256'],'helper_policy_sha256':p['full_transition']['new_policy_sha256']},config='server.conf')
|
||||
else:
|
||||
payload={'case_id':p['case_id'],'action':args.action}
|
||||
if args.action=='install':payload['central_fence']=native_rpc(central_closed,{'agent_id':p['agent_id'],'tenant_id':p['tenant_id']},config='server.conf')
|
||||
if args.action in('install','install-followup','install-stopped-followup'):payload['central_fence']=native_rpc(central_closed,{'agent_id':p['agent_id'],'tenant_id':p['tenant_id']},config='server.conf')
|
||||
if args.action=='trust':
|
||||
if args.trust_package is None:parser.error('--trust-package required for protected trust installation')
|
||||
payload['trust']=json.loads(args.trust_package.read_text())
|
||||
|
||||
@@ -84,7 +84,7 @@ def server(payload):
|
||||
require(platform=='linux','Windows signing awaits a separately qualified actual MSVC source pair; never relabel GNU')
|
||||
raw=decode(payload['canonical_payload_base64url']);require(len(raw)<=32768 and digest(raw)==payload['payload_sha256'],'exact typed public payload')
|
||||
doc=json.loads(raw)
|
||||
artifacts={1:[('7fef8d0f1e2bcf5cd6c373e567a0c17bfb08d8c780cd4d1925b6c1355e572547',16275360),('8fdc6ded02278eb18e64003d0bc7bf45d452cd48ded0450e6e900ca66e44d449',13325104)],2:[('4d212066bef226af3fa679ffe95f69c43a9668cbef7e665d53328f4e41aa3799',16273896),('89b28db3afe870c667297dff97ad7a042c550ccce1f712d69108e8de672ad450',13322944)]}
|
||||
artifacts={1:[('7fef8d0f1e2bcf5cd6c373e567a0c17bfb08d8c780cd4d1925b6c1355e572547',16275360),('eaee85d7d9d7d9592928448186d883ccb8384cdad967b5d98f47e925b9a8ae8d',13323816)],2:[('4d212066bef226af3fa679ffe95f69c43a9668cbef7e665d53328f4e41aa3799',16273896),('1a65e2d9ca7f862578c12fb3d3bff9f1a381a44ce9e8bccd47271a129e64e6e7',13328416)]}
|
||||
if payload['action']=='sign-release':
|
||||
sequence=doc['release_sequence'];require(sequence in(1,2)and doc['schema_version']==1 and doc['version']==('0.1.0'if sequence==1 else'0.1.1')and doc['platform']=='x86_64-unknown-linux-gnu'and doc['protocol_major']==1 and doc['state_schema']==1 and doc['minimum_updater_version']==1,'exact compatible release profile')
|
||||
require(str(uuid.UUID(doc['release_id']))==doc['release_id']and doc['release_id']!='00000000-0000-0000-0000-000000000000','release identity')
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"blocker": "JOURNAL_STORAGE_CAPACITY_BLOCKED",
|
||||
"databases": {
|
||||
"/var/lib/rmm-agent-remote/consumption.sqlite": {
|
||||
"bytes": 87179264,
|
||||
"consumptions": 27,
|
||||
"expected_runtime_max_pages": 262144,
|
||||
"file_id": [
|
||||
2049,
|
||||
1026450,
|
||||
993,
|
||||
984,
|
||||
33152,
|
||||
1
|
||||
],
|
||||
"freelist_count": 0,
|
||||
"integrity_check": "ok",
|
||||
"journal_mode": "delete",
|
||||
"page_count": 21284,
|
||||
"page_size": 4096,
|
||||
"unresolved_consumptions": 0
|
||||
},
|
||||
"/var/lib/rmm-agent-remote/journal.sqlite": {
|
||||
"bytes": 798998528,
|
||||
"expected_runtime_max_pages": 262144,
|
||||
"file_id": [
|
||||
2049,
|
||||
1026449,
|
||||
993,
|
||||
984,
|
||||
33152,
|
||||
1
|
||||
],
|
||||
"freelist_count": 43,
|
||||
"integrity_check": "ok",
|
||||
"jobs": 30,
|
||||
"journal_mode": "delete",
|
||||
"open_jobs": 0,
|
||||
"page_count": 195068,
|
||||
"page_size": 4096,
|
||||
"reconcile_meta": {
|
||||
"checkpoint": 10416,
|
||||
"fault": null,
|
||||
"generation": 134,
|
||||
"last_decision": "d6f2b8e3-73a4-47f7-9aa0-664b3829bfd4",
|
||||
"pending_request": null
|
||||
}
|
||||
},
|
||||
"/var/lib/rmm-helper/consumption.sqlite": {
|
||||
"bytes": 1073717248,
|
||||
"consumptions": 19,
|
||||
"expected_runtime_max_pages": 262144,
|
||||
"file_id": [
|
||||
2049,
|
||||
1031117,
|
||||
0,
|
||||
984,
|
||||
33152,
|
||||
1
|
||||
],
|
||||
"freelist_count": 0,
|
||||
"helper_sync_meta": {
|
||||
"agent_checkpoint": 10416,
|
||||
"checkpoint": 4012,
|
||||
"fault": null,
|
||||
"generation": 134,
|
||||
"last_decision": "d6f2b8e3-73a4-47f7-9aa0-664b3829bfd4"
|
||||
},
|
||||
"integrity_check": "ok",
|
||||
"journal_mode": "delete",
|
||||
"page_count": 262138,
|
||||
"page_size": 4096,
|
||||
"unresolved_consumptions": 0
|
||||
}
|
||||
},
|
||||
"general_initialization_barrier": {
|
||||
"sha256": "3029c12768998c8b9a3e21b4db55d0f1dbbf3378d058446c63a7106d6e3f3605",
|
||||
"value": {
|
||||
"authenticated_general_nonce": true,
|
||||
"job_authority": false,
|
||||
"peer_pid": 185875,
|
||||
"policy_sha256": "e177ab083ba0c239103942eb67ea9e28e9dafc294f828592cf859535a8569fd8"
|
||||
}
|
||||
},
|
||||
"helper_startup_fix_native_contract_passed": true,
|
||||
"installed_record_present": false,
|
||||
"job_authority": false,
|
||||
"no_jobs_keys_or_server_deployment": true,
|
||||
"observed_at": "2026-11-16T15:00:18.382720+00:00",
|
||||
"operation": "linux_compatible_final_read_only_v1",
|
||||
"original_identity_pki_general_metadata_unchanged": true,
|
||||
"partial_not_baseline_qualified": true,
|
||||
"preserved_original_db_effects": {
|
||||
"/var/lib/rmm-agent-remote/consumption.sqlite": {
|
||||
"consumptions": 27,
|
||||
"evidence_sha256": "e3e0b50cc10d6a34270ceed2d079973460dc1ab6ac1daacdc630b47b7dfa8ff4",
|
||||
"file_id": [
|
||||
2049,
|
||||
1026450,
|
||||
993,
|
||||
984,
|
||||
33152,
|
||||
1
|
||||
],
|
||||
"generation": null
|
||||
},
|
||||
"/var/lib/rmm-agent-remote/journal.sqlite": {
|
||||
"consumptions": 0,
|
||||
"evidence_sha256": "4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945",
|
||||
"file_id": [
|
||||
2049,
|
||||
1026449,
|
||||
993,
|
||||
984,
|
||||
33152,
|
||||
1
|
||||
],
|
||||
"generation": 134
|
||||
},
|
||||
"/var/lib/rmm-helper/consumption.sqlite": {
|
||||
"consumptions": 19,
|
||||
"evidence_sha256": "98d097633c875e90e13dd155f02e5aaea4eac5ced08db484d01c46a590339d03",
|
||||
"file_id": [
|
||||
2049,
|
||||
1031117,
|
||||
0,
|
||||
984,
|
||||
33152,
|
||||
1
|
||||
],
|
||||
"generation": null
|
||||
}
|
||||
},
|
||||
"qualification_present": false,
|
||||
"read_only": true,
|
||||
"registry_present": false,
|
||||
"services": {
|
||||
"rmm-agent-remote.service": {
|
||||
"actual_image_sha256": "7fef8d0f1e2bcf5cd6c373e567a0c17bfb08d8c780cd4d1925b6c1355e572547",
|
||||
"actual_start_ticks": "23932537",
|
||||
"status": {
|
||||
"ActiveState": "active",
|
||||
"ControlPID": "0",
|
||||
"InvocationID": "d074bc65493043a9808d22f2c6846852",
|
||||
"Job": "",
|
||||
"MainPID": "185883",
|
||||
"NRestarts": "0",
|
||||
"Restart": "on-failure",
|
||||
"Result": "success",
|
||||
"SubState": "running"
|
||||
}
|
||||
},
|
||||
"rmm-agent-updater.service": {
|
||||
"status": {
|
||||
"ActiveState": "inactive",
|
||||
"ControlPID": "0",
|
||||
"InvocationID": "",
|
||||
"Job": "",
|
||||
"MainPID": "0",
|
||||
"NRestarts": "0",
|
||||
"Restart": "no",
|
||||
"Result": "success",
|
||||
"SubState": "dead"
|
||||
}
|
||||
},
|
||||
"rmm-apt-helper.service": {
|
||||
"status": {
|
||||
"ActiveState": "inactive",
|
||||
"ControlPID": "0",
|
||||
"InvocationID": "",
|
||||
"Job": "",
|
||||
"MainPID": "0",
|
||||
"NRestarts": "0",
|
||||
"Restart": "on-failure",
|
||||
"Result": "success",
|
||||
"SubState": "dead"
|
||||
}
|
||||
},
|
||||
"rmm-full-maintenance-helper.service": {
|
||||
"actual_image_sha256": "eaee85d7d9d7d9592928448186d883ccb8384cdad967b5d98f47e925b9a8ae8d",
|
||||
"actual_start_ticks": "23932533",
|
||||
"status": {
|
||||
"ActiveState": "active",
|
||||
"ControlPID": "0",
|
||||
"InvocationID": "470671e2096647708c14fb4c40aa346a",
|
||||
"Job": "",
|
||||
"MainPID": "185880",
|
||||
"NRestarts": "0",
|
||||
"Restart": "no",
|
||||
"Result": "success",
|
||||
"SubState": "running"
|
||||
}
|
||||
},
|
||||
"rmm-helper-cloud.service": {
|
||||
"actual_image_sha256": "eaee85d7d9d7d9592928448186d883ccb8384cdad967b5d98f47e925b9a8ae8d",
|
||||
"actual_start_ticks": "23932456",
|
||||
"status": {
|
||||
"ActiveState": "active",
|
||||
"ControlPID": "0",
|
||||
"InvocationID": "c75736c6835f4282af63fdf1f07ea403",
|
||||
"Job": "",
|
||||
"MainPID": "185875",
|
||||
"NRestarts": "0",
|
||||
"Restart": "on-failure",
|
||||
"Result": "success",
|
||||
"SubState": "running"
|
||||
}
|
||||
}
|
||||
},
|
||||
"source_startup_fix_commit": "6195e2b",
|
||||
"trust_policy_present": false
|
||||
}
|
||||
@@ -266,3 +266,68 @@ Originalhistorien erneut prüfen, die drei betroffenen Dateien mit erhaltenen
|
||||
Vorgängern ersetzen und vor Fullstart eine tatsächlich authentisierte
|
||||
General-Policyprobe bestehen. Erst die folgende normale signierte Synchronisierung
|
||||
kann die neue Baseline qualifizieren.
|
||||
|
||||
## Tatsächlicher Folgebootstrap, anschließend angehalten
|
||||
|
||||
Der freigegebene Folgefall
|
||||
`devstate/linux-updater-compatible/8fa5c0bd-b0ae-45ec-8cde-3d766d0576d4`
|
||||
stellte die neue Helperbinary und die zwei exakt gerenderten Fulldateien bereit.
|
||||
Die native staged Binary reproduzierte den erwarteten Fullpin unabhängig:
|
||||
Policy-SHA256 `4b0900b3f3fe550d829352b6174649bd1e64aa89bdf766ec07f49ee04c582877`.
|
||||
Agent `7fef…` und stabiler Updater `dec6…` wurden nicht ersetzt.
|
||||
|
||||
Beim ersten Stopvergleich zeigte sich ein enges administratives Statusproblem:
|
||||
`systemctl stop` lässt einen bereits gescheiterten Dienst unter Umständen im
|
||||
Zustand `failed`, obwohl MainPID/ControlPID null und Job/Cgroup leer sind.
|
||||
Der Controller brach deshalb **vor jeder Dateiänderung** ab. Es gab ausschließlich
|
||||
das ursprüngliche Stopintent, keine Swapintents/Kandidaten/Vorgänger. Der
|
||||
Fehlerzustand wurde weder mit `reset-failed` gelöscht noch ein Stop wiederholt.
|
||||
Eine eigene, auf genau diesen Fall beschränkte Fortsetzung prüfte anschließend
|
||||
die identische ursprüngliche InvocationID/Exit-1-/`NRestarts=0`-/`Restart=no`-
|
||||
Bindung, beendete Original-PIDs, unveränderte Originaldateien, Datenbank-Inodes,
|
||||
Wirkungsaggregate und Retainedmetadaten. Unter beiden gehaltenen Originalflocks
|
||||
ersetzte sie danach genau die drei Dateien, mit create-only erhaltenen
|
||||
Vorgängern. Unklare oder schon begonnene Swaps werden von diesem Pfad verweigert.
|
||||
|
||||
Die vorhandenen Units und Updaternamespace wurden unverändert übernommen.
|
||||
General bestand vor Fullstart eine echte Policy-Challenge als provisionierte
|
||||
UID 993 mit geprüftem Rootpeer/PID, exaktem Policyhash und ursprünglichen
|
||||
Ledger-/Lock-Inodes. Die Antwort enthielt weder Snapshot noch freigegebene
|
||||
Grants. Danach starteten Full und Agent. Der abschließende rein lesende Beleg
|
||||
zeigt tatsächlich:
|
||||
|
||||
| Rolle | Zustand | PID | Tatsächliche Imagebytes |
|
||||
|---|---|---:|---|
|
||||
| Agent | active/running | 185883 | `7fef…` |
|
||||
| General | active/running | 185875 | `eaee…` |
|
||||
| Full | active/running | 185880 | `eaee…` |
|
||||
| Stabiler Updater | inactive | 0 | installiert, nicht gestartet |
|
||||
| APT | inactive | 0 | unverändert geschlossen |
|
||||
|
||||
Alle drei ursprünglichen Datenbank-Inodes, die 27 Agent- und 19 Rootverbräuche
|
||||
samt Originalevidenzen sowie sämtliche ursprünglichen Identitäts-/PKI-/
|
||||
Generalmetadaten blieben erhalten. Datenbankintegrität ist jeweils `ok`, keine
|
||||
offene Wirkung und kein Reconcile-/Helperfault. Es gab keine Betriebssystem-
|
||||
oder Paketoperation, keinen Reboot, keinen Job, keine Signierschlüsselerzeugung
|
||||
und keinen Serverdeploy.
|
||||
|
||||
Die Baselinequalifikation bleibt trotzdem **nicht bestanden**: Das tatsächliche
|
||||
Helperlog meldet `JOURNAL_STORAGE_CAPACITY_BLOCKED`, der Agent schließt mit
|
||||
`SYNC_OR_TRANSPORT_DEPENDENCY_UNAVAILABLE`. Beide Metas bleiben bei derselben
|
||||
ursprünglichen Generation 134/Entscheidung
|
||||
`d6f2b8e3-73a4-47f7-9aa0-664b3829bfd4`; es wurde kein neuer normaler signierter
|
||||
Abgleich behauptet. Der Rootledger besitzt tatsächlich 262138 Seiten à 4096
|
||||
Bytes und null freie Seiten. Die normative Grenze beträgt 262144 Seiten
|
||||
(1 GiB; Spezifikation Kapitel 0, Journalbudgetentscheidung). Die nächsten
|
||||
Captures passen offenbar nicht mehr in die verbleibenden sechs Seiten; die
|
||||
beobachtete konkrete Verweigerung wird nicht durch Anheben des Limits oder
|
||||
Löschen/Ersetzen von Historie umgangen. Agentjournal: 195068 Seiten/43 frei;
|
||||
Agentverbrauch: 21284 Seiten/0 frei. Dieser Kapazitätspunkt braucht eine eigene
|
||||
verbindliche Lösung, bevor neue Linux-Wirkungen oder Updaterabnahmen möglich sind.
|
||||
|
||||
Auf ausdrückliche neue Fokussierung auf die Windows-SYSTEM-PowerShell-Abnahme
|
||||
wurde Linux nach genau diesem lesenden Schlussbeleg angehalten. Es gibt
|
||||
weiterhin keinen Baselinequalifikationsrecord, keine Registry, keinen Trust,
|
||||
keinen gestarteten Updater und keinen Updateauftrag.
|
||||
[Tatsächlicher Schlussbeleg](evidence/linux-updater-helper-followup-final.json),
|
||||
SHA256 `7c69a4ac4f295cef4e6bf6feacb86492ee3066cbadf7eeda7772e1b4285edb2a`.
|
||||
|
||||
Reference in New Issue
Block a user