diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index cec2edd..bdad2a4 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -6,8 +6,8 @@ source functions.sh -# Trap the signals for container exit and run gracefull_exit function -trap 'gracefull_exit' SIGQUIT SIGKILL SIGTERM +# Trap the signals for container exit and run graceful_exit function +trap 'graceful_exit' SIGQUIT SIGTERM # Prepare, format and define initial variables diff --git a/Dockerfile b/Dockerfile index eb648c3..a5a1572 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,5 +25,6 @@ ENV FAN_SPEED 5 ENV CPU_TEMPERATURE_THRESHOLD 50 ENV CHECK_INTERVAL 60 ENV DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE false +ENV KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT false CMD ["./Dell_iDRAC_fan_controller.sh"] diff --git a/README.md b/README.md index ad81a5f..e4f00d0 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ docker run -d \ -e CPU_TEMPERATURE_THRESHOLD= \ -e CHECK_INTERVAL= \ -e DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE= \ + -e KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT= \ --device=/dev/ipmi0:/dev/ipmi0:rw \ tigerblue77/dell_idrac_fan_controller:latest ``` @@ -98,6 +99,7 @@ docker run -d \ -e CPU_TEMPERATURE_THRESHOLD= \ -e CHECK_INTERVAL= \ -e DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE= \ + -e KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT= \ tigerblue77/dell_idrac_fan_controller:latest ``` @@ -119,6 +121,7 @@ services: - CPU_TEMPERATURE_THRESHOLD= - CHECK_INTERVAL= - DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE= + - KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT= devices: - /dev/ipmi0:/dev/ipmi0:rw ``` @@ -141,6 +144,7 @@ services: - CPU_TEMPERATURE_THRESHOLD= - CHECK_INTERVAL= - DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE= + - KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT= ```

(back to top)

@@ -157,6 +161,7 @@ All parameters are optional as they have default values (including default iDRAC - `CPU_TEMPERATURE_THRESHOLD` parameter is the T°junction (junction temperature) threshold beyond which the Dell fan mode defined in your BIOS will become active again (to protect the server hardware against overheat). **Default** value is 50(°C). - `CHECK_INTERVAL` parameter is the time (in seconds) between each temperature check and potential profile change. **Default** value is 60(s). - `DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE` parameter is a boolean that allows to disable third-party PCIe card Dell default cooling response. **Default** value is false. +- `KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT` parameter is a boolean that allows to keep the third-party PCIe card Dell default cooling response state upon exit. **Default** value is false, so that it resets the third-party PCIe card Dell default cooling response to Dell default.

(back to top)

diff --git a/functions.sh b/functions.sh index e8dd2bf..a0922ab 100644 --- a/functions.sh +++ b/functions.sh @@ -86,9 +86,15 @@ function disable_third_party_PCIe_card_Dell_default_cooling_response () { # } # Prepare traps in case of container exit -function gracefull_exit () { +function graceful_exit () { apply_Dell_fan_control_profile - enable_third_party_PCIe_card_Dell_default_cooling_response + + # Reset third-party PCIe card cooling response to Dell default depending on the user's choice at startup + if ! $KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT + then + enable_third_party_PCIe_card_Dell_default_cooling_response + fi + echo "/!\ WARNING /!\ Container stopped, Dell default dynamic fan control profile applied for safety." exit 0 }