README.md 5.39 KB
Newer Older
Rusty Myers's avatar
Rusty Myers committed
1 2 3
IdleLogout.app
==============

Rusty Myers's avatar
Rusty Myers committed
4 5
Description
------------
6
Application to log out users after a specified period of time. The user will see a prompt with a countdown asking them if they wish to log out or continue working ("More Time"). Users can disable the Idle Logout process using the "Disable Idle Logout.applescript". Remote Control (VNC/ARD over port 5900) will block the logout process unless SkipRemoteControlCheck is set to True in the preference file. A optional script can be run before a user is logged out.
Rusty Myers's avatar
Rusty Myers committed
7

8 9
**The Idle Logout App will force close any applications the user has open. This will not save any data!**

Rusty Myers's avatar
Rusty Myers committed
10
Screen Shot of Count Down Window:
Rusty Myers's avatar
Rusty Myers committed
11
![window]
Rusty Myers's avatar
Rusty Myers committed
12

13
Download latest package: [Idle Logout.app](https://git.psu.edu/sysman/IdleLogout/tree/master/IdleLogout%20Builds)
14

15 16
Installation
-------------
Rusty Myers's avatar
Rusty Myers committed
17

18
The IdleLogout-V.v.pkg installs the Idle Logout.app into /Library/CLMshared/Startup Items/ and the [LaunchAgent](https://git.psu.edu/sysman/IdleLogout/blob/master/IdleLogout%20Builds/LaunchAgent/edu.psu.idlelogout.plist) to open it in /Library/LaunchAgents/.
Rusty Myers's avatar
Rusty Myers committed
19

20
The Idle Logout.app will write log files into the /Users/Shared/IdleLogout/ folder.
21 22 23

You can deploy the "Disable Idle Logout.applescript", as a compiled app, to give users an easy way to stop the Idle Logout process. This is helpful in locations where users need to allow processes to run for longer than you're normal logout time.

Rusty Myers's avatar
Rusty Myers committed
24 25 26

Preferences
-------------
27
The Idle Logout.app looks for the preference file "/Library/Preferences/edu.psu.idlelogout.plist" (included in the repo under '[IdleLogout Builds/Preference/](https://git.psu.edu/sysman/IdleLogout/blob/master/IdleLogout%20Builds/Preference/edu.psu.idlelogout.plist)' folder). It looks for the following key/string pairs in the plist. If they are missing, it will use the defaults:
Rusty Myers's avatar
Rusty Myers committed
28 29 30 31 32 33

* IgnoreUser = Ignore the username, don't force logout.
* IgnoreGroup = Ignore anyone in this group, don't force logout.
* ComputerIdleAfterNumSeconds = Number of seconds before considering the computer abandoned.
* IdleLoopDelaySeconds = Number of seconds to wait between checking the usb idle seconds.
* WaitForUserPromptSeconds = Number of seconds to wait for user to respond to logout prompt.
34 35
* WindowTitle = Changes the name shown in the logout window. Uses String.
* WindowMessage = Changes the text shown on the logout window. Uses String.
36 37
* SkipRemoteControlCheck = Skips ARD check and logs out if TRUE.
* LogOutScriptPath = Run a script before user is logged out. Can be any script the terminal supports.
Rusty Myers's avatar
Rusty Myers committed
38 39 40 41 42 43 44

Default Values if plist is not installed:

* IgnoreUser = "macadmin"
* IgnoreGroup = "admin"
* ComputerIdleAfterNumSeconds = "600"
* IdleLoopDelaySeconds = "30"
Rusty Myers's avatar
Rusty Myers committed
45
* WaitForUserPromptSeconds = "90"
Rusty Myers's avatar
Rusty Myers committed
46
* WindowTitle = "PSU Idle Logout"
47
* WindowMessage = "This Mac is idle.\n\nClick the \"More Time\" button to continue using the Mac.\n\nOtherwise, an automatic logout will occur and all unsaved documents will be LOST!"
48
* SkipRemoteControlCheck = False
49
* LogOutScriptPath = None
50 51 52 53 54 55 56 57 58 59

Defaults can be set quickly for all users using defaults write:

* defaults write /Library/Preferences/edu.psu.idlelogout.plist IgnoreUser -string clcclmadmin
* defaults write /Library/Preferences/edu.psu.idlelogout.plist IgnoreGroup -string user
* defaults write /Library/Preferences/edu.psu.idlelogout.plist ComputerIdleAfterNumSeconds -string 10
* defaults write /Library/Preferences/edu.psu.idlelogout.plist IdleLoopDelaySeconds -string 5
* defaults write /Library/Preferences/edu.psu.idlelogout.plist WaitForUserPromptSeconds -string 120
* defaults write /Library/Preferences/edu.psu.idlelogout.plist WindowTitle -string "Our Idle Logout"
* defaults write /Library/Preferences/edu.psu.idlelogout.plist WindowMessage "You're going to be logged out\n\n\nDude\!"
60
* defaults write /Library/Preferences/edu.psu.idlelogout.plist SkipRemoteControlCheck -bool FALSE
61
* defaults write /Library/Preferences/edu.psu.idlelogout.plist LogOutScriptPath -string "/path/to/script.sh"
Rusty Myers's avatar
Rusty Myers committed
62

63 64 65 66 67 68 69
Background
------------
Idle Logout.app was written in Xojo 2015 R3. It uses the ioreg command to determine how long USB devices have been idle. Once the idle limit is meet, the computer is forcibly restarted to log out any users.

The terminal command we use to check idle seconds on USB devices is:
> /bin/echo $((`/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/sed -e '/HIDIdleTime/ !{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000))

Rusty Myers's avatar
Rusty Myers committed
70 71
ToDo
-------------
72
* No Known Issues - Please use Issues to report any.
73 74 75

Completed
------------
76
* 10/2017 - Adding SkipRemoteControlCheck to log out even if remote control is true. Added script run during logout process.
RUSSELL MYERS's avatar
RUSSELL MYERS committed
77
* 01/2017 - Updated preferences to use CFPrefsD through macoslibs. Update code to Cocoa (Only update UI from main thread).
78
* 01/2015 - The path to the logout script should be set in the preference file OR the script should be part of the app.
RUSSELL MYERS's avatar
RUSSELL MYERS committed
79
* 01/2015 - Make it part of the .app, create a new method to log out
80
* 01/2015 - Add preference key for window wording.
Rusty Myers's avatar
Rusty Myers committed
81 82 83 84 85

Attribution
------------
Application Icon modified from original, used with CC license:
From http://www.flickr.com/photos/23453447@N02/5107438855/sizes/o/in/photostream/
Rusty Myers's avatar
Rusty Myers committed
86
By zyrquel: http://www.flickr.com/photos/23453447@N02/
Rusty Myers's avatar
Rusty Myers committed
87

Rusty Myers's avatar
Rusty Myers committed
88 89 90
Full Screen Shot of Countdown Window:
![full]

91 92
[full]: https://git.psu.edu/sysman/IdleLogout/raw/master/IdleLogout%20Builds/screenshots/full.png "Full Screen Shot"
[window]: https://git.psu.edu/sysman/IdleLogout/raw/master/IdleLogout%20Builds/screenshots/window.png "Windowed Screen Shot"