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

    Feature request: Option to resume/re-run snapins interrupted by an installer-initiated reboot (behavior changed since 1.6)

    Scheduled Pinned Locked Moved Feature Request
    7 Posts 2 Posters 38 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
      lf88
      last edited by

      Hi everyone,

      we use FOG to fully automate the installation of our PCs at the university, including several snapins for larger software packages. Some of these installers require a reboot in the middle of the installation and trigger that reboot themselves.

      Behavior up to FOG 1.5.10:
      When an installer rebooted the machine during the snapin run, the snapin task stayed open. After the reboot, the FOG client checked in again, received the same snapin task and the installation continued. This worked reliably for us and was an important part of our deployment workflow.

      Behavior since FOG 1.6:
      After the installer-initiated reboot, the snapin is no longer delivered again. The installation is left incomplete and has to be finished manually.

      I understand that the recommended approach is to suppress the installer’s reboot and use the “Reboot after install” option instead, and that the old behavior was probably more of a side effect than an intended feature. However, for complex installers with multiple stages this means splitting them into several snapins or writing wrapper scripts for each package, which is a lot of extra work and maintenance.

      Feature request:
      It would be very helpful to have a per-snapin option like “Resume after reboot” (or “Re-run if interrupted by a reboot”). If enabled, a snapin task that was started but never reported completion before the client rebooted would be delivered again on the next check-in. To prevent endless reboot loops, a configurable maximum number of retries (e.g. 3) would make sense, after which the task is marked as failed.

      Optionally, the client could also treat the common “reboot required” exit codes (3010 / 1641) as “success, reboot needed” and handle the reboot itself.

      Environment:
      FOG server version: 1.6.0.158
      FOG agent version: 0.1.2X
      Server OS: Ubuntu 24.04 LTS
      Client OS: Windows 11
      Example snapins affected: Siemens TIA Portal

      Finally, I’d like to say a big thank you to the whole FOG team. FOG has been a core part of our deployment workflow for years, and it’s impressive how much you’ve built and maintained as an open-source project, along with the support you provide here in the forum. Your work saves us countless hours every week, and we really appreciate it!

      Tom ElliottT 2 Replies Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott @lf88
        last edited by

        @lf88 Thanks for the detailed report. On 1.6 the server still sends an interrupted snapin again, but the new agent can report the installer’s exit before Windows stops the agent, and that report closes the task. We are confirming this in the lab and will fix it in the agent, with a retry limit so a looping installer ends as failed. To help confirm: on the host’s snapin task, what exit code and status does the UI show for the TIA Portal run? The agent log line starting snapin “<name>” (task N): shows the same thing. Also, 3010 and 1641 are already treated as “success, reboot needed” by default, and the agent then reboots the machine.

        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
        • Tom ElliottT
          Tom Elliott @lf88
          last edited by

          @lf88 Update: in our lab, an installer that reboots the machine mid-run did get its snapin run again after the reboot, so the cause I described is not confirmed. The exit code you see on the TIA Portal snapin task is now the key piece. If the installer exits with a code before the reboot, the agent reports it and the task closes. Please also post the agent log lines around the reboot (C:\ProgramData\FOG\ log, lines starting snapin " and snapin result:).

          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
          • L
            lf88
            last edited by

            @Tom-Elliott Thanks a lot for looking into this so quickly!

            One detail I should have mentioned: the snapin is not the installer itself but a PowerShell script. The script reads the installation data directly from an SMB share and starts the installer, so the agent only sees the exit code of my script. I do it this way on purpose: the installation sources for TIA Portal and LabVIEW are around 50 GB, and this way they don’t have to be copied to every PC (possibly several times) as snapin files.

            Here are the relevant lines from C:\ProgramData\FOG\fogagent.log from a test run:

            2026-12-01T15:01:11+01:00 snapin “Siemens TiaPortal V19” (task 20183): ran, exit 11641, outcome failed (Enabling Windows Feature NetFX3)
            2026-12-01T15:01:11+01:00 update: deferred, a reboot is pending
            2026-12-01T15:01:11+01:00 reboot: applied (1 user(s) logged in, 60s warning (snapin: snapin “Siemens TiaPortal V19”), mode reboot)

            So your first theory is confirmed: my script passes the installer’s exit code back to the agent, the agent reports it as failed and closes the task, and then the agent itself reboots the machine. After the reboot the task is already closed, so the snapin isn’t run again. Unfortunately I can no longer reproduce exactly what was different under 1.5.10, since we’ve already migrated all our systems. My guess is that the old client simply didn’t get to report the exit code before the shutdown, but I can’t verify that anymore.

            The installers we use have dedicated exit codes for “not finished yet, reboot needed”:

            Siemens TIA Portal: 11641 = NotCompleteReboot, 13010 = NotCompleteRebootRequired (plus the usual 0 / 1641 / 3010 and error codes)
            NI Package Manager (LabVIEW): -125071 = “A system reboot is needed to complete the transaction”, -125804 = “The transaction finished successfully. A system reboot was triggered.”

            Both installers allow suppressing their own reboot, so I could handle this entirely in my script. But the cleaner way would be for FOG to do the reboot and keep track of it: the agent already reboots the machine in this case anyway, and with FOG in charge, every stage (run, reboot, re-run, final result) would be logged and visible on the snapin task.

            So it would be great if a snapin could tell the agent “reboot and run me again”, for example via configurable exit codes per snapin, with the retry limit you mentioned. Then my script could simply pass these codes through and FOG would handle the rest.

            Thanks again for the quick help and for all your work on FOG!

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

              @lf88 Thanks for the log line. It confirmed the cause. Your script passes the installer’s exit code 11641 through. FOG read that code as failed and closed the task. Then the snapin’s reboot setting rebooted the machine, so nothing ran again.

              FOG now has a return-code class for this case: reboot_rerun. The agent reboots the computer, then runs the same snapin task again. One task can do this at most 5 times. The sixth answer marks the task failed.

              Update first. You need FOG dev-branch (it adds schema 492) and fog-agent 0.1.38 or later on every computer that gets the snapin. With update mode Latest, the agents update themselves after the ring delay. Check the agent version on the host before you change the snapin. An older agent does not know reboot_rerun. It runs TIA Portal again at the next check-in with no reboot, up to 5 times, and then the task fails.

              Then set the snapin’s Return Codes:

              0=success
              3010=reboot
              11641=reboot_rerun
              13010=reboot_rerun
              

              For NI Package Manager, add -125071=reboot_rerun and -125804=reboot_rerun.

              Also:

              • Keep passing the installer’s exit code through.
              • Stop the installer from rebooting by itself. FOG does the reboot.
              • Clear Reboot after install on this snapin.

              Details: https://docs.fogproject.org/management/web/snapins#return-codes

              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
              • L
                lf88
                last edited by

                @Tom-Elliott Wow, thank you so much! That was incredibly fast, and reboot_rerun is exactly what I was hoping for.

                I haven’t been able to test it yet. I’ll update to the dev-branch and fog-agent 0.1.38, set up the return codes as you described and report back how it works.

                One thing I noticed while going through our old logs from the 1.5.10 days: TIA Portal sometimes needed up to 8 reboots for a full installation, depending on which components and prerequisites were already present. These logs come from my PowerShell script, which writes its own log for every run. If that’s still the case, the fixed limit of 5 re-runs would probably not be enough, and these installations would end up as failed even though everything is working as intended.

                Would it be possible to make the maximum number of reboot_rerun cycles configurable? For example:

                a per-snapin setting (e.g. “Max reboot re-runs”), since the number of reboots depends heavily on the installer, and
                a global default in the FOG settings (keeping 5 as the default value) for all snapins that don’t override it.

                That way the protection against endless reboot loops stays in place, but large multi-stage installers like TIA Portal could get a higher limit (e.g. 10) without affecting other snapins.

                Thanks again for all your work, this already helps us a lot!

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

                  @lf88 Good point about the 8 reboots. Each snapin now has its own limit.

                  The snapin edit page has a new field, Max reboot re-runs. The range is 1 to 20, and the default is 5. Existing snapins keep 5. There is no global setting, because the right number depends on the installer. For TIA Portal, set it to 10.

                  This is on dev-branch now (schema 493). If you updated to dev-branch before this post, update once more, then run the schema update. The agent does not change: 0.1.38 is still the version you need.

                  When a task uses up its limit, it fails with “Reboot and run again limit (N) reached.” in the task details.

                  Details: https://docs.fogproject.org/management/web/snapins#return-codes

                  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

                  45

                  Online

                  12.8k

                  Users

                  17.7k

                  Topics

                  157.6k

                  Posts
                  Copyright © 2012-2026 FOG Project