[10.11.x] Need to disable auto-logout but keep screen lock on

endor-moon
Contributor II

Our animation students are seeing a problem in our Yosemite labs where they begin a render in Maya and the computer tries to auto-logout, killing the render. The machine doesn't actually logout because the unsaved changes in Maya prevents that. I didn't specify auto-logout so I'm not sure where the machine is getting this as a default behaviour.

The behaviour I would like to see is auto-logout permanently disabled and students should be able to enable screen lock so they can protect their renders while they go home for sleep. The lab systems automatically do a hard reboot at 6 AM every morning (reboot now in a script kicked off by cron).

This all worked fine under Mavericks. Under Yosemite, it seems the auto-logout can be turned off if the student disables screen lock in the GUI: System Preferences, Security & Privacy, uncheck "Require password [x seconds or minutes] after sleep or screen saver begins, then "Are you sure you want to turn off screen lock, [Turn Off Screen Lock]. Which seems to turn off auto-logout but leaves the machine wide open for other students to mess with. They'll put signs on the machines, "rendering, do not touch" but it seems like a waste of paper.

After Casper Imaging, I run a script to set Energy Saver settings as follows:

#!/bin/sh
# Power management settings

# erase any existing schedule
pmset repeat cancel
# startup or wake every weekday at 4:45 AM
pmset repeat wakeorpoweron MTWRF 04:45:00
# wake on magic packet
pmset womp 1
# restart after power fails, always
systemsetup -setrestartpowerfailure on
# never sleep, disks never, displays in 30
pmset -a sleep 0 disksleep 0 displaysleep 30
# darkwakes should be off if supported
pmset -c darkwakes 0

I'm wondering if I've done something wrong in the power settings script above to cause this behaviour and how to disable auto-logout permanently. I found some commands to turn it off but it only seems to work until the next reboot:

defaults write GlobalPreferences com.apple.autologout.AutoLogOutDelay 0
osascript -e 'tell application "System Events" to set require password to wake of security preferences to true'
1 ACCEPTED SOLUTION

bpavlov
Honored Contributor

Do you have any configuration profiles applied to the computer? If you are and one of them has the Login Window payload, make sure that you have "Log Out Users After: X minute of inactivity" is UNCHECKED.

View solution in original post

2 REPLIES 2

bpavlov
Honored Contributor

Do you have any configuration profiles applied to the computer? If you are and one of them has the Login Window payload, make sure that you have "Log Out Users After: X minute of inactivity" is UNCHECKED.

endor-moon
Contributor II

Hi @bpavlov

Actually, there is a policy named Disable Auto-Logout that is triggered at recurring check-in, but it appears I forgot to call the script, which I believe I downloaded from JAMF. I have modified the policy so we'll see what happens. Thanks for the tip.