Macjutsu / super

S.U.P.E.R.M.A.N. optimizes the macOS software update experience.
Apache License 2.0
637 stars 86 forks source link

Unattended Mode and Maintenance Windows #26

Closed jshirle2 closed 2 months ago

jshirle2 commented 2 years ago

I would love to see Super support an unattended mode and/or maintenance windows. Unattended mode would ensure Super only installs/reboots when no one is logged into the machine. Maintenance Windows only allow Super to install/restart during specific time frames. The original use case for this were computer labs and/or Libraries where the machines could be accessed at any point during the day but we don't want to disrupt the experience of the user at all if possible; there are large parts of the day where the machine is unattended however. Deferrals do not work in this instance as it will be a different user each time and would just add confusion.

Thanks!

Macjutsu commented 2 years ago

Good ideas here. During the maintenance window would you want to force the update/restart if someone was logged into the system? I ask because if there was a habitually logged in computer it would never update/restart.

jshirle2 commented 2 years ago

In my mind that is what the unattended mode would be for. So, if you had a maintenance window set from 2 AM to 6 AM, and unattended mode is false (default I would assume) then Super would just start a countdown to reboot the system. I am not familiar enough with the options yet to know whether that could just utilize another option you already have created.

An admin could be extra safe and use unattended mode = true and maintenance windows 2 AM to 6 AM to only install updates during the time if no one was logged into the machine (that is probably what I would use for my initial use case).

KUSU2 commented 2 years ago

This would help with our needs as well. We use an auto logout profile so if a lab machine is unattended it logs the user out after x minutes (standard jamf settings profile). It does not always work though as certain apps keep the session alive if the user leaves them running. A "killall loginwindow" usually gets the user off so we can continue maintenance or a forced reboot (for some reason the reboot doesn't always work). A force out option with Super would help nicely with unattended maintenance windows.

wakco commented 2 years ago

I'm interested in this too, my focus has been or staff computers but we do have labs here as well, where I'd like to limit it to weekends, however I was thinking about limiting all the defer features, and having a jamf policy to run it limited to the weekends.

tranziq commented 2 years ago

you could put an IDLE timeout variable for unattended install. say if no input from keyboard or mouse for ~45 minutes, start the startosinstall unattended and force restart.

jshirle2 commented 2 years ago

@tranziq Yeah that isn't a bad addition. A bit risky though, so definitely needs to be optional.

tranziq commented 2 years ago

Here is what we are using for our idle timeout function.

fIdleTime() { local _idle=$(echo $((ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/ !{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'/ 1000000000))) echo ${_idle} | sed 's/ //g' }

if [ "${fIdleTime}" -ge 2700 ] && [ "${currentDeferalCount}" -ge "${9}" ]; then continue workflow else Defer

Macjutsu commented 2 years ago

Thanks for this! I look forward to implementing this in v4.0.

mauriciope commented 2 years ago

This will be very useful to several of our hot desks/shared iMacs.

One thing we had feedback from our end users while doing in place macOS upgrades is that it is happening during working hours, when they are "very very busy", and instead of deferrals they would like to set a date/time to when it will happen. This would be another implementation but it could fall under this "maintenance window" and force/set the update/upgrade there and then.

Macjutsu commented 3 months ago

This is partially implemented via the new scheduled installation options in https://github.com/Macjutsu/super/releases/tag/v5.0.0-beta2

It would be entirely too complicated to have multiple simultaneous workflows... instead you can override your default workflow with a temporary workflow until complete.

Macjutsu commented 2 months ago

This was a HUGE undertaking... literally thousands of lines of code to implement this in super...

Please check out the latest build... https://github.com/Macjutsu/super/releases/tag/v5.0.0-beta3

jshirle2 commented 2 months ago

Holy cow! This sounds amazing. Going to test this out and hopefully implement for Fall term at our school. You are the best!