autosuspend.conf
autosuspend config file Documentation
- Provided by: autosuspend (Version: 1.0.0-2)
- Report a bug
autosuspend config file Documentation
/etc/autosuspend.conf
Configures the autosuspend daemon.
The autosuspend configuration file uses INI syntax and needs to be processable by the Python configparser module.
A simple configuration file could look like:
[general] interval = 30 idle_time = 900 suspend_cmd = /usr/bin/systemctl suspend [check.Ping] enabled = false hosts = 192.168.0.7 [check.RemoteUsers] class = Users enabled = true name = .* terminal = .* host = [0-9].*
The configuration file consists of a [general] section, which specifies general processing options, and multiple options of the format [check.*]. These sections describe the checks to execute to determine inactivity.
The [general] section contains options controlling the overall behavior of the autosuspend daemon. These are:
For each check to execute, a section with the name format [check.*] needs to be created. Each check has a name and an executing class which implements the behavior. The fraction of the section name check. determines the name, and in case no class option is given inside the section, also the class which implements the check. In case the option:`class option is specified, the name is completely user-defined and the same check can even be instantiated multiple times with differing names.
For each check, these generic options can be specified:
Furthermore, each check might have custom options.
The following checks for activity are currently implemented. Each of the is described with its available configuration options and required optional dependencies.
Checks whether one or more hosts answer to ICMP requests.
Checks whether an instance of MPD is currently playing music.
Checks whether an instance of Kodi is currently playing.
Checks whether a user currently logged in at the system matches several criteria. All provided criteria must match to indicate activity on the host.
All regular expressions are applied against the full string. Capturing substrings needs to be explicitly enabled using wildcard matching.
Any active Samba connection will block suspend.
If currently running processes match an expression, the suspend will be blocked. You might use this to hinder the system from suspending when for example your rsync runs.
Checks whether there is currently a client connected to a TCP server at certain ports. Can be used to e.g. block suspending the system in case SSH users are connected or a web server is used by clients.
Checks whether the system load 5 is below a certain value.
Checks whether all active local X displays have been idle for a sufficiently long time. This assumes a recent operating system where the X server is started with user permissions (i.e. not as root).
The options of individual checks are outlined below.
Johannes Wienke
2017, Johannes Wienke