Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2864

Systemd service enabled status

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.12.0, 3.10.4
    • Fix Version/s: 3.10.5, 3.12.1
    • Component/s: Promise type: services
    • Labels:
      None
    • Platform:
      Linux
    • Found in version (details):
      3.12.0

      Description

      Hi,

      I would like to report that the standard_services policy in the standard library doesn't properly detect whether a systemd service is enabled or not.

      In the current implementation, cfengine parses the output of systemctl show and checks if UnitFileState=enabled as shown on this line : https://github.com/cfengine/masterfiles/blob/092371f6241598f483b202d9593139b3f263f0ae/lib/services.cf#L231

       The problem is that UnitFileState is misleading as it can take many values, and among these values all the following describe an enabled service : enabled-runtime, indirect, generated, and transient.

      I see two ways to fix the current implementation : either use the systemctl is-enabled command, which will take care of these details correctly, or fix the parsing to check for these additional values.

      Thank you for making cfengine so great!

      Have a nice day,

        Attachments

          Activity

            People

            • Assignee:
              a10042 Nick Anderson
              Reporter:
              Adyxax Julien Dessaux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel