Skip to content

Commit 410963c

Browse files
tolushaclaude
andauthored
chore: document CLI Watcher to prevent workspace idling (#3068)
* procedures: document CLI Watcher to prevent workspace idling Add a procedure article explaining how to configure the CLI Watcher via a .noidle file to prevent workspace idling when long-running CLI tools are active in the terminal. Source: eclipse-che/che-machine-exec#333 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address review feedback for CLI Watcher procedure - Use imperative title, add [role="_abstract"], fix passive voice - Use unordered list for alternative config locations - Consolidate inline NOTEs into admonition block - Add .Verification section - Rename file with proc_ prefix per CQA P3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fixup Signed-off-by: Anatolii Bazko <abazko@redhat.com> --------- Signed-off-by: Anatolii Bazko <abazko@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b59ac8f commit 410963c

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

modules/end-user-guide/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*** xref:accessing-fuse.adoc[]
2626
*** xref:enabling-overlay-with-a-configmap.adoc[]
2727
** xref:running-containers-with-kubedock.adoc[]
28+
** xref:proc_preventing-workspace-idling-for-long-running-commands.adoc[]
2829
* xref:using-che-in-team-workflow.adoc[]
2930
** xref:first-time-contributors.adoc[]
3031
** xref:benefits-of-pull-requests-review-in-che.adoc[]
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
:_content-type: PROCEDURE
2+
:description: Preventing {prod-short} workspace idling when long-running CLI tools are active in the terminal, so that unattended tasks can complete without interruption.
3+
:keywords: user-guide, workspace, idling, idle, timeout, cli-watcher, noidle
4+
:navtitle: Prevent workspace idling for long-running commands
5+
:page-aliases:
6+
7+
[id="preventing-workspace-idling-for-long-running-commands"]
8+
= Prevent workspace idling for long-running commands
9+
10+
[role="_abstract"]
11+
Prevent a workspace from stopping while long-running CLI tools such as `helm`, `odo`, or `sleep` are active, so that unattended tasks can complete without interruption.
12+
13+
The CLI Watcher periodically checks for running processes that match the commands you specify. When it detects an active watched command, it resets the workspace idle timer. This configuration works entirely in user space and does not require administrator privileges.
14+
15+
.Prerequisites
16+
17+
* You have a running {prod-short} workspace.
18+
19+
.Procedure
20+
21+
. Create a `.noidle` file in your workspace:
22+
+
23+
[source,yaml]
24+
----
25+
enabled: true
26+
watchedCommands:
27+
- helm
28+
- odo
29+
- sleep
30+
checkPeriodSeconds: 60
31+
----
32+
+
33+
Where:
34+
+
35+
--
36+
`enabled`:: Enables or disables the CLI Watcher. Set to `true` to activate it.
37+
`watchedCommands`:: A list of command names to monitor. When any of these commands are detected as a running process, the workspace idle timer is reset.
38+
`checkPeriodSeconds`:: The polling interval in seconds. The default value is `60`.
39+
--
40+
41+
. Place the `.noidle` file in one of the following locations, listed from highest to lowest priority:
42+
+
43+
* Set the `CLI_WATCHER_CONFIG` environment variable to the absolute path of your `.noidle` file.
44+
* Place the file in your project directory or any parent directory up to `$PROJECTS_ROOT`. The watcher searches upward from the current project directory.
45+
* Place the file in your home directory as `~/.noidle`.
46+
+
47+
If the CLI Watcher finds no configuration file, it waits and checks again on the next poll cycle.
48+
49+
.Verification
50+
51+
. Start a watched command in the terminal (for example, `sleep 600`).
52+
. Verify that the workspace remains active beyond the configured idle timeout.
53+
54+
[NOTE]
55+
====
56+
The `.noidle` file supports live updates. You can add, edit, or remove the file while the workspace is running. Changes are picked up automatically on the next poll cycle.
57+
58+
The following processes are always excluded from watching and do not prevent workspace idling: PID 1 (the main container process) and `tail`.
59+
====

0 commit comments

Comments
 (0)