@@ -339,18 +339,21 @@ def compose_up(
339339 if existing_hash != new_hash :
340340 changed_services .append (svc )
341341
342- # When the pod is being (re)started it auto-starts its containers.
343- # Exclude container services to avoid double-starting them.
342+ # When the pod is being restarted, containers with PartOf=<pod>
343+ # are restarted too via systemd propagation. Exclude container
344+ # services from the restart list to avoid double-restarting them.
345+ # However, starting the pod does NOT auto-start new containers
346+ # (that requires systemctl enable + WantedBy=), so new container
347+ # services must still be started explicitly.
344348 pod_svc : str | None = None
345349 container_svcs : set [str ] = set ()
346350 for filename in quadlet_files :
347- if filename .endswith (' .pod' ):
351+ if filename .endswith (" .pod" ):
348352 pod_svc = quadlet_to_service (filename )
349- elif filename .endswith (' .container' ):
353+ elif filename .endswith (" .container" ):
350354 container_svcs .add (quadlet_to_service (filename ))
351- if pod_svc and pod_svc in set ( changed_services ) | set ( new_services ) :
355+ if pod_svc and pod_svc in changed_services :
352356 changed_services = [s for s in changed_services if s not in container_svcs ]
353- new_services = [s for s in new_services if s not in container_svcs ]
354357
355358 # Write quadlet files directly to the unit directory
356359 track_operation (
0 commit comments