Skip to content

Commit

Permalink
Update cfg documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mountassir committed Dec 29, 2018
1 parent ad2c21e commit c278950
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,17 @@ $ sudo make install
```

# Usage:
Download the executable from the latest release or compile your own from the source code in the folder "src", update the config file sspender.cfg and run the executable:
Download the executable from the latest release or compile your own from the source code in the folder "src", update the config file sspender.cfg and run the executable.

As sspender relies on hdparm and rtcwake to spin down the drives and suspend the machine, sspender needs to be executed as root. You can run it as a normal user and it will still monitor all the devices, but it won't be able to spin down the drives or suspend the machine.

``` bash
$ sudo sspender sspender.cfg
```

To direct logs to /var/log/sspender.log
``` bash
$ sspender sspender.cfg
$ sudo sspender sspender.cfg > /var/log/sspender.log 2>&1 &
```

# Limitations:
Expand Down
26 changes: 15 additions & 11 deletions sspender.cfg
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
# sample config file

# Do not un-comment the next two lines, documentation only.
#idle_load_threshold - The device is considered busy if load is more than this value (%)
#idle_time_threshold - The device is considered idle if the load is less than idle_load_threshold for this period of time (minutes)

setting =
{
//Will not suspend machine if any of these IPs is online
//Will not suspend machine if any of these IPs is online, empty string "" to disable
ips_to_watch = "192.168.1.50";

//Times when machine should be awake
//Times when machine should be awake, empty string "" to disable
wake_at = "1:00,16:00";

//Sleep modes are: disk, mem or stand_by (default is disk)
sleep_mode = "mem";

devices_to_monitor =
{
//Monitor all the attached disks, the machine will only suspend if they are all idle
//Monitor all the attached disks, the machine will only suspend if they are all idle (default is false)
all_disks = false;

//CPU configs
cpu =
{
no_suspend_if_not_idle = false, //The machine will not suspend if the cpu is busy (default is true)
idle_load_threshold: 5, //The device is considered busy if load is more than this value
idle_time_threshold: 1 //The device is considered idle if the load is less than idle_load_threshold for this period of time
no_suspend_if_not_idle = true, //Machine will not suspend if the cpu is busy (default is true)
idle_load_threshold: 5, //Default is 5%
idle_time_threshold: 1 //Default is 1 minute
};

//Disks configs, add disks separated by comma {sda...},{sdb...} ...
disks =
(
{
name: "sda", //Device name
uuid: "sda-uuid", //Device uuid
# uuid: "sda-uuid", //Or use device uuid
no_suspend_if_not_idle: false, //The machine will not suspend if this device is busy (default is true)
spind_down_if_idle: true, //Spin the drive down if it's idle (default is false)
idle_load_threshold: 5, //The device is considered busy if load is more than this value
idle_time_threshold: 1 //The device is considered idle if the load is less than idle_load_threshold for this period of time
spind_down_if_idle: false, //Spin the drive down if it's idle (default is false)
idle_load_threshold: 5, //Default is 5%
idle_time_threshold: 1 //Default is 1 minute
}
);
};
Expand All @@ -52,4 +56,4 @@ tuning =
//Suspend the machine if it has been idle for more than (x minute) (default is 15)
suspend_after = 15;
};
};

0 comments on commit c278950

Please sign in to comment.