{"record":{"id":"fd3dc11236790a78","repo":"puppetlabs/puppet","slug":"cannot-manage-legacy-services-through-smf","errorCode":null,"errorMessage":"Cannot manage legacy services through SMF","messagePattern":"Cannot manage legacy services through SMF","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/service/smf.rb","lineNumber":227,"sourceCode":"      states = service_states\n      state = states[:next] || states[:current]\n    rescue Puppet::ExecutionFailure => e\n      # TODO (PUP-8957): Should this be set back to INFO ?\n      debug \"Could not get status on service #{name} #{e}\"\n      return :stopped\n    end\n\n    case state\n    when \"online\"\n      :running\n    when \"offline\", \"disabled\", \"uninitialized\"\n      :stopped\n    when \"maintenance\"\n      :maintenance\n    when \"degraded\"\n      :degraded\n    when \"legacy_run\"\n      raise Puppet::Error,\n            \"Cannot manage legacy services through SMF\"\n    else\n      raise Puppet::Error,\n            \"Unmanageable state '#{state}' on service #{name}\"\n    end\n  end\n\n  # Helper that encapsulates the clear + svcadm [enable|disable]\n  # logic in one place. Makes it easy to test things out and also\n  # cleans up flush's code.\n  def maybe_clear_service_then_svcadm(cur_state, subcmd, flags)\n    # If the cur_state is maint or degraded, then we need to clear the service\n    # before we enable or disable it.\n    adm('clear', service_fmri) if [:maintenance, :degraded].include?(cur_state)\n    adm(subcmd, flags, service_fmri)\n  end\n\n  # The flush method is necessary for the SMF provider because syncing the enable and ensure","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/service/smf.rb#L209-L245","documentation":"The SMF provider maps svcs state strings to Puppet symbols; the mapping explicitly refuses 'legacy_run' with 'Cannot manage legacy services through SMF'. A legacy_run state means the service was started through the legacy rc/init mechanism (svcs reports it under the legacy zone/path) and is not an SMF-managed instance, so svcadm cannot control it.","triggerScenarios":"status evaluation of a service resource (provider => 'smf') whose svcs state line reads legacy_run — typically a Solaris 10-style rc script started via /etc/rc?.d or a legacy service visible to svcs but outside SMF control.","commonSituations":"Migrating Solaris 10 hosts where daemons still run from rc scripts; third-party installers that start services legacy-style; manifests assuming every svcs-listed service is SMF-managed.","solutions":["Check how it runs: svcs -l and ps to confirm the legacy rc-script origin","Convert the daemon to a real SMF service (write/import a manifest with svccfg import) and manage that FMRI","Or manage it outside SMF with the init-style provider/commands and stop listing it under smf","Stop the legacy instance before enabling the SMF one to avoid duplicates"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"svcs -H -o state \"${name}\" 2>/dev/null | grep -qx legacy_run \\\n  && echo \"legacy rc service — manage via init commands, not SMF\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Convert legacy rc daemons to SMF manifests (svccfg import) before managing them with the smf provider","Audit new Solaris hosts for legacy_run entries and route them to an init-based profile","Stop the legacy instance before enabling the SMF replacement to avoid split-brain daemons"],"tags":["puppet","solaris","smf","legacy-run","unsupported-state"],"backgroundTag":"unsupported-resource-state","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}