Prevent workspace idling for long-running commands
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.
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.
-
You have a running Che workspace.
-
Create a
.noidlefile in your workspace:enabled: true watchedCommands: - helm - odo - sleep checkPeriodSeconds: 60Where:
enabled-
Enables or disables the CLI Watcher. Set to
trueto activate it. 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.
checkPeriodSeconds-
The polling interval in seconds. The default value is
60.
-
Place the
.noidlefile in one of the following locations, listed from highest to lowest priority:-
Set the
CLI_WATCHER_CONFIGenvironment variable to the absolute path of your.noidlefile. -
Place the file in your project directory or any parent directory up to
$PROJECTS_ROOT. The watcher searches upward from the current project directory. -
Place the file in your home directory as
~/.noidle.If the CLI Watcher finds no configuration file, it waits and checks again on the next poll cycle.
-
-
Start a watched command in the terminal (for example,
sleep 600). -
Verify that the workspace remains active beyond the configured idle timeout.
|
The The following processes are always excluded from watching and do not prevent workspace idling: PID 1 (the main container process) and |