diff --git a/README.md b/README.md index 136be2d..c5d820a 100644 --- a/README.md +++ b/README.md @@ -131,9 +131,20 @@ between keepalives, lower it. - Only one process may talk to the serial port. The script takes an exclusive `flock` on `/run/das_fanctl.lock` and exits rather than interleaving garbage with another writer. Detach `attachDAS.sh`'s `screen` session before starting the service. -- The disk glob is `/dev/disk/by-path/*-sas-exp*-lun-0` — anything behind a SAS expander, - i.e. the shelf. The host's own drives hang off `pci-…-scsi-*` and are not matched. A - second enclosure would be lumped in with the first. +- **`DISK_GLOB` must name the shelf's HBA on any host with more than one.** The default + `*-sas-exp*-lun-0` means "behind a SAS expander", which is not the same as "in the + shelf": a server's own backplane is frequently behind an expander too. On `iz-pve0` the + internal drives sit on `pci-0000:02:00.0` and the shelf on `pci-0000:04:00.0`, so the + default glob matched all 17 drives and would have set the shelf's fans from the + server's internal drive temperatures. Set + `Environment=DISK_GLOB=/dev/disk/by-path/*04:00.0*-lun-0` in the unit. +- **The server's own fan controller needs the mirror-image setting.** Whichever host the + shelf is plugged into must set `DISK_EXCLUDE_PATTERN` to that same HBA in + `fan_speed.service`, or the shelf's drives drive the *server* fans as well. Moving the + shelf between hosts means moving both settings. +- `PORT` is per host too. Check which UART actually answers rather than assuming: + `grep -v uart:unknown /proc/tty/driver/serial` lists the real ones, then send + `_temp_rd` to each and watch for the `BlueDress` prompt. ## Files diff --git a/das_fanctl.sh b/das_fanctl.sh index 5443502..aa28e75 100755 --- a/das_fanctl.sh +++ b/das_fanctl.sh @@ -7,7 +7,7 @@ source /root/fan_speed/functions.sh -PORT=/dev/ttyS1 +PORT=${PORT:-/dev/ttyS1} LOG=/root/fan_speed/log/das_fan.log CHECK_INTERVAL=30 # seconds between temperature readings KEEPALIVE_INTERVAL=5 # re-send _shutup this often, the DAS forgets it otherwise @@ -16,7 +16,11 @@ HIGH_FAN_SPEED=60 # Disks in the enclosure - anything behind the DAS SAS expander. The server's own # drives hang off pci-...-scsi-* instead, so this glob does not pick them up. -DISK_GLOB='/dev/disk/by-path/*-sas-exp*-lun-0' +# Drives in THIS shelf. "-sas-exp" alone is not enough to identify an enclosure: +# a server's own backplane is often behind an expander too, and on iz-pve0 the +# internal drives sit on pci-0000:02:00.0 while the shelf is on 04:00.0. Name the +# shelf's HBA explicitly on any host with more than one. +DISK_GLOB=${DISK_GLOB:-/dev/disk/by-path/*-sas-exp*-lun-0} DISK_LOW_TEMPERATURE_THRESHOLD=40 # at/below this -> LOW_FAN_SPEED (idle spread is 32-39c) DISK_HIGH_TEMPERATURE_THRESHOLD=50 # at/above this -> HIGH_FAN_SPEED