Esempio n. 1
0
    def execute(self):
        unit_name = "initial-setup.service"
        services_proxy = SERVICES.get_proxy()
        setup_on_boot = services_proxy.SetupOnBoot

        if setup_on_boot == SETUP_ON_BOOT_DISABLED:
            log.debug("The %s service will be disabled.", unit_name)
            util.disable_service(unit_name)
            # Also tell the screen access manager, so that the fact that post installation tools
            # should be disabled propagates to the user interaction config file.
            screen_access.sam.post_install_tools_disabled = True
            return

        if not os.path.exists(os.path.join(util.getSysroot(), "lib/systemd/system/", unit_name)):
            log.debug("The %s service will not be started on first boot, because "
                      "it's unit file is not installed.", unit_name)
            return

        if setup_on_boot == SETUP_ON_BOOT_RECONFIG:
            log.debug("The %s service will run in the reconfiguration mode.", unit_name)
            # write the reconfig trigger file
            f = open(os.path.join(util.getSysroot(), "etc/reconfigSys"), "w+")
            f.close()

        log.debug("The %s service will be enabled.", unit_name)
        util.enable_service(unit_name)
Esempio n. 2
0
    def execute(self):
        unit_name = "initial-setup.service"
        services_proxy = SERVICES.get_proxy()
        setup_on_boot = services_proxy.SetupOnBoot

        if setup_on_boot == SETUP_ON_BOOT_DISABLED:
            log.debug("The %s service will be disabled.", unit_name)
            util.disable_service(unit_name)
            # Also tell the screen access manager, so that the fact that post installation tools
            # should be disabled propagates to the user interaction config file.
            screen_access.sam.post_install_tools_disabled = True
            return

        if not os.path.exists(
                os.path.join(util.getSysroot(), "lib/systemd/system/",
                             unit_name)):
            log.debug(
                "The %s service will not be started on first boot, because "
                "it's unit file is not installed.", unit_name)
            return

        if setup_on_boot == SETUP_ON_BOOT_RECONFIG:
            log.debug("The %s service will run in the reconfiguration mode.",
                      unit_name)
            # write the reconfig trigger file
            f = open(os.path.join(util.getSysroot(), "etc/reconfigSys"), "w+")
            f.close()

        log.debug("The %s service will be enabled.", unit_name)
        util.enable_service(unit_name)
Esempio n. 3
0
    def run(self):
        for service_name in self._disabled_services:
            log.debug("Disabling service: %s.", service_name)
            util.disable_service(service_name, root=self._sysroot)

        for service_name in self._enabled_services:
            log.debug("Enabling service: %s.", service_name)
            util.enable_service(service_name, root=self._sysroot)
Esempio n. 4
0
 def _enable_service(self):
     """Enable the Initial Setup service."""
     if self._unit_file_exists(self.INITIAL_SETUP_UNIT_NAME):
         util.enable_service(self.INITIAL_SETUP_UNIT_NAME)
     else:
         log.debug(
             "Initial Setup will not be started on first boot, because "
             "its unit file (%s) is not installed.",
             self.INITIAL_SETUP_UNIT_NAME)
Esempio n. 5
0
    def execute(self):
        services_proxy = SERVICES.get_proxy()

        for svc in services_proxy.DisabledServices:
            log.debug("Disabling the service %s.", svc)
            util.disable_service(svc)

        for svc in services_proxy.EnabledServices:
            log.debug("Enabling the service %s.", svc)
            util.enable_service(svc)
Esempio n. 6
0
    def _enable_service(self):
        """Enable or disable the chrony service."""
        if not util.is_service_installed(NTP_SERVICE, root=self._sysroot):
            log.debug("The NTP service is not installed.")
            return

        if self._ntp_enabled:
            util.enable_service(NTP_SERVICE, root=self._sysroot)
        else:
            util.disable_service(NTP_SERVICE, root=self._sysroot)
Esempio n. 7
0
    def execute(self):
        services_proxy = SERVICES.get_proxy()

        for svc in services_proxy.DisabledServices:
            log.debug("Disabling the service %s.", svc)
            util.disable_service(svc)

        for svc in services_proxy.EnabledServices:
            log.debug("Enabling the service %s.", svc)
            util.enable_service(svc)
Esempio n. 8
0
    def run(self):
        unit_name = "initial-setup.service"
        if self._setup_on_boot == SetupOnBootAction.DISABLED:
            log.debug("Initial Setup will be disabled.")
            util.disable_service(unit_name)
            return

        if not os.path.exists(os.path.join(self._sysroot, "lib/systemd/system/", unit_name)):
            log.debug("Initial Setup will not be started on first boot, because "
                      "it's unit file (%s) is not installed.", unit_name)
            return

        if self._setup_on_boot == SetupOnBootAction.RECONFIG:
            log.debug("Initial Setup will run in reconfiguration mode.")
            # write the reconfig trigger file
            f = open(os.path.join(self._sysroot, "etc/reconfigSys"), "w+")
            f.close()

        log.debug("Initial Setup will be enabled.")
        util.enable_service(unit_name)