Skip to content

[Featured][systemd] Generated service should not be enabled in featured#383

Open
mlok-nokia wants to merge 1 commit into
sonic-net:masterfrom
mlok-nokia:skip_enable_generated_service
Open

[Featured][systemd] Generated service should not be enabled in featured#383
mlok-nokia wants to merge 1 commit into
sonic-net:masterfrom
mlok-nokia:skip_enable_generated_service

Conversation

@mlok-nokia
Copy link
Copy Markdown
Contributor

@mlok-nokia mlok-nokia commented May 11, 2026

Why I did it

On multiasic platform, with Trixie, there will be services that will be defined in /run/systemd/generator as "generatad" UnitFileState. Such as PMON, SNMP, radv and other are generated service. Enabling such services fails because it's assumed to be always enabled. This PR modifies the featured to skip enabling the generated services. Fix issue sonic-net/sonic-buildimage#25414

Work item tracking
  • Microsoft ADO (number only):

How I did it

Featured always enabled the service files based on the configuration of the feature table. This PR add code to check is UnitFileState is generated, skip and not append the "systemctl enable " command to the cmds list.

How to verify it

bootup the new image in the multiasic platform, the following log should not be seen in the syslog:

2026 Feb  4 05:37:49.443422  sonic ERR featured: ['sudo', 'systemctl', 'enable', 'eventd.service'] - failed: return code - 1, output:              
2026 Feb  4 05:37:55.587767 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'pmon.service'] - failed: return code - 1, output:             
2026 Feb  4 05:37:58.027168 soinc ERR featured: ['sudo', 'systemctl', 'enable', 'radv.service'] - failed: return code - 1, output:
2026 Feb  4 05:40:41.483658 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'gnmi.service'] - failed: return code - 1, output:              
2026 Feb  4 05:40:49.039632 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'mgmt-framework.service'] - failed: return code - 1, output:              
2026 Feb  4 05:40:51.358646 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'snmp.service'] - failed: return code - 1, output:

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant