Snapins - Snapins with reboot after cause infinite boot loop
-
I upgraded to 7591/client10.6 this morning - and since then I’ve got infinite boot loop happening when snapins are being deployed;
Snapin 1 (no reboot after) runs, installs, disappears from task list
snapin 2 (no reboot after) runs, installs, disappears from task list
snapin 3 (reboot after) runs, installs, disappears from task list
snapin 4 (no reboot after) - checked in
(client reboots)
next checkin, snapins 1,2,3 suddenly show up in the snapin task list, and the cycle restarts.I can break the loop by unchecking reboot after install on snapin 3.
Any idea’s whats going on? this worked on 7224 (was using client 9.x (9.6?))
-
Can you please share the details of snapin 3 please? Screen shots would be appreciated.
Also alerting @Senior-Developers because this sounds like a server side issue.
-
reboot.ps1
Start-Transcript -path c:\SnapinLogs\Reboot.log #restart-computer echo "Fogservice will issue reboot, this is a dummy file" Stop-Transcript
I’ve got tons of other powershell snapins that work fine (infact, snapin 1 and 2 are powershell), so it’s not powershell related. Simply unchecking “reboot after install” will break the loop, but is obviously not the desired operation.
I’ll see if I can pull an apache log to see if there is anything pertinent in there.
yes, I realize I could simply put the reboot after on the snapin prior - but some people I work with require a more visual aid to see whats going on, hence the snapin
-
@Developers any ideas? This seems like a server-side issue to me. Somehow when the task is completed, it gets re-made.
Somehow I think that multiple snapins - with one set to restart - is causing this. I can try to confirm tonight.
-
does the powershell script file end on a space, newline, or a character?
legacy client or new?
if the purpose of the script is to restart the computer, why not have the restart command in the powershell script? -
@Junkhacker said in Snapins - Snapins with reboot after cause infinite boot loop:
if the purpose of the script is to restart the computer, why not have the restart command in the powershell script?
That’s a good solution, but still we need to figure out what’s causing the reboot loop.
-
@Wayne-Workman well, if it’s the legacy client, i probably know what the issue is. more knowledgeable devs can correct me if i’m wrong here, but the way the client checks to see if the task has completed is by waiting for the exit code of the program it launches. for an .msi install, this is msiexec.exe for powershell, this is powershell.exe, for a bat file, that’s cmd.exe ( i think). the issue is that msiexec.exe and powershell.exe may exit before the script they’re running (as a subprocess) is finished, providing an exit code and making the client think that it’s finished. this only really seems to be an issue when there’s a reboot involved, because then it doesn’t get the time to actually finish. (or when the running of a snapin relies on the previous snapin having completed, since it can run prematurely)
edit: this may also be an issue with the new client. i don’t know. ask jbob on that one. i don’t know as much about the new client. i hope to start using it more soon -
I had thought of the restart in the power shell script - but thats a problem as the next snapin starts executing while the host shuts down.
The snapin runs fine with a clean exit - and this did work before I upgraded from client9.X/trunk7224 to client10.6/trunk7591
Powershell with -File runs the script called in the current environment - not as a separate thread/subproccess - so it does wait for the script to completely finish before exiting.
-
@Mentaloid could you update again and test? I added some better checking to the code that should prevent the re-insert of previously completed taskings.
-
@Tom-Elliott
Thanks Tom, whatever you changed seems to have fixed things right up!Reboot after is now working without causing tasks to be re-created when next checkin occurs.
You guys are awesome - did I mention that before?