I have setup a key watch, see config below. It does not seem to be firing.
Interestingly, if I setup the same watch from the cli it works perfectly.
/consul/config/watches.json
{
“watches”: [
{
“type”: “key”,
“key”: “configs/webcoma/dev”,
“handler_type”: “script”,
“args”: [“sh”, “-c”, “/usr/bin/log-coma-dev.sh”, “dev”]
},
{
“type”: “key”,
“key”: “configs/webcoma/qa”,
“handler_type”: “script”,
“args”: ["/usr/bin/log-coma-dev.sh", “qa”]
}
]
}
this command works:
consul watch -type=key -key=configs/webcoma/dev /usr/bin/log-coma-dev.sh
There is no error, the script just is not running from what I can tell.
When I use the cli command it works, when I run it from the server it works. When I use the above watches json it does not. When I reload the config, I get no errors and the log.txt file is created. But when I update the value, the script does not run.
Here is my script:
#!/bin/sh
echo “This is running” >> ~/logs/log.txt
echo “This is running”