Forum
Welcome, Guest
Username: Password: Remember me
This is the optional category header for the Suggestion Box.
  • Page:
  • 1

TOPIC:

Code Problem & Fix 5 years 4 months ago #1708

  • Nathan Scannell
  • Nathan Scannell's Avatar Topic Author
  • Offline
  • Posts: 38
Code Problem in 7.6.0:

Line 369 of /etc/ha-lizard/ha-lizard.sh produces error in log when running "ha-cfg log"....

ha-lizard-ERROR-/etc/ha-lizard/init/ha-lizard.mon: /etc/ha-lizard/ha-lizard.sh: line 369: [: =: unary operator expected

Line 369 refers to if statement.
if [ $ha_lizard_STAT = "true" ]

Fix: Requires quotes
if [ "$ha_lizard_STAT" = "true" ]

Please Log in or Create an account to join the conversation.

Last edit: by Nathan Scannell.

Code Problem & Fix 5 years 4 months ago #1711

  • Nathan Scannell
  • Nathan Scannell's Avatar Topic Author
  • Offline
  • Posts: 38
Sorry... i should be more specific...

This is noted in XCP-ng 7.6.0

The variable $ha_lizard_STAT doesn't seem to require quotes in XCP-ng 7.5.0

Please Log in or Create an account to join the conversation.

Code Problem & Fix 5 years 4 months ago #1713

  • Salvatore Costantino
  • Salvatore Costantino's Avatar
  • Offline
  • Posts: 722
Thanks. I'll take a look

Please Log in or Create an account to join the conversation.

Code Problem & Fix 5 years 4 months ago #1719

  • Salvatore Costantino
  • Salvatore Costantino's Avatar
  • Offline
  • Posts: 722
Nice catch. Thanks. This has been added to the release I'll post shortly.

The quotes will suppress the error.. The root cause is likely an empty or missing state file which causes the variable to be unset. Probably related to the XCP 7.6 issue

Please Log in or Create an account to join the conversation.

  • Page:
  • 1