• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Feature request: option to run a software item only after the host has been renamed and joined to the domain (with record failed Chocolatey packages)

    Scheduled Pinned Locked Moved Unsolved FOG Problems
    2 Posts 2 Posters 8 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lperoma
      last edited by

      Hello everyone,

      I would like to propose a small option on a software item (or on a group association): “run only after the host has been renamed and joined to the domain”.

      Today, on a fresh deploy, the agent enrolls, runs the snapins and then runs the Chocolatey software module, and only after that does it rename the host and join it to the domain, which ends in a reboot. That order is fine for Chrome or VLC. It is a problem for installers that do their real work in a second stage after the first one returns. Our case is the Avast Business agent: the MSI returns 0 in about ten seconds, but the antivirus itself is downloaded and installed afterwards, over the next few minutes. If the join reboot lands in the middle, the install can be left half done, and from FOG’s side everything looks fine because the Chocolatey package reported success.

      What we do today is a workaround inside the package script: if the computer name is still the image name, the script throws on purpose, so nothing gets installed, and then we rely on FOG running the software again after the reboot. It works, but it has some rough edges that a native option would remove:

      • When the script throws, the software status row for that host is not updated. It keeps the old state (converged from a previous run), so the web UI never shows that the package failed. We only knew from the host itself.

      • We had to rely on the retry. By watching the web server log we saw that after each boot the agent runs the Chocolatey module about four times, roughly a minute apart, and then not again for hours (we saw passes about every six hours). So if the retry after the join reboot is missed, the next chance is a long way off.

      • The software status list of the host survives a new deploy. When an image is deployed, pending tasks such as snapins are cleared, but the old software status rows stay, so a freshly cloned host still shows software as converged or installed from the previous install. That is also why a failed package could not be told apart from an old success. The machine is new after a deploy, so that list should not be kept.

      • We first tried to detect “not joined yet” with the domain membership, but that does not work: the agent renames the host and joins the domain in the same step, and both only become effective after the reboot, so right before it Windows already reports the host as part of the domain while it still has the image name. The host name was the only reliable signal.

      So the request would be, in order of importance:

      1. An option per software item (or per group) to defer it until after the rename/join reboot.

      2. Recording a failed Chocolatey run in the software status (failed, with the output), instead of leaving the previous status.

      3. Clearing the host’s software status list when a deploy finishes, the same way pending snapin tasks are cleared, since the machine is new.

      I am not sure the ordering is the only thing behind our Avast problem, since we also had a separate crash of the vendor installer that seems unrelated, so I am only asking for the generic behavior, which would help with any installer that continues working after it returns.

      Happy to share logs or test a patch if it helps. Thanks!

      Tom ElliottT 1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott @lperoma
        last edited by

        @lperoma Thanks for the detail. On the first two points: the next agent release will hold software until the rename/join reboot has happened, and a finished deploy will clear the host’s software status.

        On the status row not updating: the server writes that row on every report, failures included, so something else is happening. Could you post the agent log lines from the pass where the script threw? Look for the line that starts with software "<your package id>":, plus the matching lines in the web server log. Also, which page shows the stale converged: the host’s Software tab, or the installed-software inventory?

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        36

        Online

        12.8k

        Users

        17.7k

        Topics

        157.6k

        Posts
        Copyright © 2012-2026 FOG Project