From 8d56ba72110f085f9b12d4d78abfac65f9e96a4b Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Nov 2024 19:52:12 +0100 Subject: [PATCH 1/3] Add new parameter DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE_ON_EXIT to allow users to specify whether or not they want the Dell Third-Party PCIe Card Default Cooling Response Logic disabled on exit. --- Dockerfile | 1 + README.md | 5 +++++ functions.sh | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) 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..6e2ca1a 100644 --- a/functions.sh +++ b/functions.sh @@ -88,7 +88,13 @@ function disable_third_party_PCIe_card_Dell_default_cooling_response () { # Prepare traps in case of container exit function gracefull_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 } From 6ec7143705af50b5d9e7f6f53d428c1742cb8869 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Nov 2024 19:52:12 +0100 Subject: [PATCH 2/3] Fix typo --- Dell_iDRAC_fan_controller.sh | 4 ++-- functions.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index cec2edd..21df675 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 SIGKILL SIGTERM # Prepare, format and define initial variables diff --git a/functions.sh b/functions.sh index 6e2ca1a..a0922ab 100644 --- a/functions.sh +++ b/functions.sh @@ -86,7 +86,7 @@ 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 # Reset third-party PCIe card cooling response to Dell default depending on the user's choice at startup From 96f6200808cb08064ba2cdfe6c1b866f60338ebe Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 10 Nov 2024 19:52:12 +0100 Subject: [PATCH 3/3] Remove SIGKILL from the trap, as SIGKILL cannot be trapped. --- Dell_iDRAC_fan_controller.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dell_iDRAC_fan_controller.sh b/Dell_iDRAC_fan_controller.sh index 21df675..bdad2a4 100644 --- a/Dell_iDRAC_fan_controller.sh +++ b/Dell_iDRAC_fan_controller.sh @@ -7,7 +7,7 @@ source functions.sh # Trap the signals for container exit and run graceful_exit function -trap 'graceful_exit' SIGQUIT SIGKILL SIGTERM +trap 'graceful_exit' SIGQUIT SIGTERM # Prepare, format and define initial variables