Type random commands in terminals, then wait a few minutes.
/var/log/jupyter.log contents:
Notebook is idle. Last activity time = 2023-04-07 15:27:02.004000
Terminal 1 is not idle. Last activity time = 2023-04-07 15:34:06.549102
Terminal 2 is not idle. Last activity time = 2023-04-07 15:35:01.070414
Notebook not idle. Pass.
Notebook is idle. Last activity time = 2023-04-07 15:27:02.004000
Terminal 1 is not idle. Last activity time = 2023-04-07 15:35:03.711165
Terminal 2 is idle. Last activity time = 2023-04-07 15:35:01.070414
Notebook not idle. Pass.
Notebook is idle. Last activity time = 2023-04-07 15:27:02.004000
Terminal 1 is not idle. Last activity time = 2023-04-07 15:36:03.047135
Terminal 2 is idle. Last activity time = 2023-04-07 15:35:01.070414
Notebook not idle. Pass.
Notebook is idle. Last activity time = 2023-04-07 15:27:02.004000
Terminal 1 is idle. Last activity time = 2023-04-07 15:37:02.624094
Terminal 2 is idle. Last activity time = 2023-04-07 15:35:01.070414
Closing idle notebook
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available:
Description of changes: Added code to query for activity in terminals, prevent shutdown if terminal is not idle.
Testing Done
[X] Notebook Instance created successfully with the Lifecycle Configuration
[X] Notebook Instance stopped and started successfully
[NA] Documentation in the script around any network access requirements
[NA] Documentation in the script around any IAM permission requirements
[X] CLI commands used to validate functionality on the instance
[NA] New script link and description added to README.md
Two terminals open.
root crontab entry, run every minute for testing, look for idleness of 60 seconds.
Type random commands in terminals, then wait a few minutes.
/var/log/jupyter.log contents:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.