super icon indicating copy to clipboard operation
super copied to clipboard

Solution to the issue with Scheduled Installs

Open TechTrekkie opened this issue 10 months ago • 6 comments

There is an issue that has been reported about Scheduled Installs not running at the date/time they are scheduled. I did some research and believe I have found the cause and solution.

in the #super script, Line 5360 , the calculation for determining the deferral_timer_scheduled_install_minutes is workflow_scheduled_install_epoch - workflow_time_epoch) / 60 I believe the problem is that the workflow_time_epoch appears to get set at the beginning of the runtime, and If the update takes time to download and prepare, and/or restart dialog is displayed for a user for a long period of time because they are either away or choose to ignore it, the time between those two epoch's grows, erroneously inflating the calculation. The WorkflowScheduledInstall datetime appears correct, but the NextAutoLaunch is inflated with

I added workflow_time_epoch=$(date +%s) above that line to set it to the current time, and that appears to calculate the proper deferral minutes. I'm doing some additional testing but so far this looks to be the problem/solution.

i've attached a verbose log with the invalid calculation, and another verbose log from after adding that fix

superLogVerbose - invalid Deferral Minutes.log superLogVerbose - Valid Deferral Minutes.log

TechTrekkie avatar Jan 15 '25 23:01 TechTrekkie

I think I'm seeing the same thing. Super ran at 9:02, I scheduled the update for 13:03 (4 hours or 240 mins later) but Super deferred for 409 Minutes.

Mon Jan 20 06:13:08 Rory Powell super[90886]: **** S.U.P.E.R.M.A.N. 5.0.0 - macOS Sequoia Beta 15.3-24D5055b MINOR UPDATE VIA SOFTWAREUPDATE **** Mon Jan 20 06:13:08 Rory Powell super[90886]: Status: Previously downloaded macOS minor update is prepared: macOS Sequoia 15.3 Beta 3-24D5055b Mon Jan 20 06:13:08 Rory Powell super[90886]: Status: Focus days deadline of 2025-01-20 (1 day(s) after 2025-01-19:11:41) has passed. Mon Jan 20 06:13:08 Rory Powell super[90886]: Status: Soft days deadline of 2025-01-21 (2 day(s) after 2025-01-19:11:41) not passed. Mon Jan 20 06:13:08 Rory Powell super[90886]: Status: Hard days deadline of 2025-01-23 (4 day(s) after 2025-01-19:11:41) not passed. Mon Jan 20 06:13:08 Rory Powell super[90886]: IBM Notifier: User choice dialog with a 300 second timeout. Mon Jan 20 09:01:43 Rory Powell super[90886]: Status: User chose to schedule the installation. Mon Jan 20 09:01:44 Rory Powell super[90886]: IBM Notifier: User scheduled install selection dialog with a 300 second timeout. Mon Jan 20 09:01:44 Rory Powell super[90886]: IBM Notifier: Scheduled install selection starts at 2025/01/20 09:03:45 with a maximum end date of 2025/01/21 00:00:01. Mon Jan 20 09:02:14 Rory Powell super[90886]: Status: User chose to schedule installation for MON 2025-01-20:13:03. Mon Jan 20 09:02:14 Rory Powell super[90886]: Status: Scheduled installation on MON 2025-01-20:13:03, deferring for 409 minutes from now. Mon Jan 20 09:02:14 Rory Powell super[90886]: IBM Notifier: Scheduled installation warning dialog (this dialog has no timeout). Mon Jan 20 09:02:14 Rory Powell super[90886]: Exit: super is scheduled to automatically relaunch at: 2025-01-20:15:51:00 Mon Jan 20 09:02:14 Rory Powell super[90886]: **** S.U.P.E.R.M.A.N. 5.0.0 - EXIT CLEAN ****

Rorzzer avatar Jan 20 '25 05:01 Rorzzer

Specifically, where does 409 minutes come from? My calculation says it should be ~240 minutes.

Mon Jan 20 09:02:14 Rory Powell super[90886]: Status: Scheduled installation on MON 2025-01-20:13:03, deferring for 409 minutes from now.

Rorzzer avatar Jan 20 '25 05:01 Rorzzer

I included the explanation in the original post. Its the difference between the time the script started and the time the scheduled restart was submitted.

Ex: You scheduled the restart to be 4 hours ahead (240 mins) but the amount of time between the actual script starting and you scheduling the restart was 169 minutes, totaling 409 minutes. Could be a combination of the time it took the update to prepare and how long the restart dialog displayed before the schedule restart button was clicked.

TechTrekkie avatar Jan 20 '25 08:01 TechTrekkie

I tested this but it doesn't seem to have resolved the issue for me unfortunately. Attaching a verbose log.

super.log

gockmana avatar Feb 13 '25 14:02 gockmana

@gockmana looks like you're using the scheduled install reminders. There's still something wrong with the reminder workflow that's causing a delay to the scheduled restart. The fix was just for the scheduled install date issue. Someone else reported that they were able to resolve it by implementing my fix plus using a combination of reminders but making sure to end it with 2 minutes. example:

<key>ScheduledInstallReminder</key>
<string>120,60,5,2</string>

TechTrekkie avatar Feb 13 '25 18:02 TechTrekkie

Thank you for the clarification. I tested again with 2 minutes added at the end of the combination of reminders and it worked as intended.

gockmana avatar Feb 14 '25 17:02 gockmana