-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind mounted config.yaml does not automatically reload #151
Comments
I've tried it with the exact steps you've outlined, and I wasn't able to reproduce the issue. Note that the file changes aren't picked up instantly - there's a job for changes every 30 seconds. |
Thanks for the confirmation. Will double check and update later. |
I can reproduce at my side but I am not sure what is going wrong. |
Not sure why was this closed, I'm having the same issue on a freshly-installed gatus instance. FWIW the mount point is a glusterfs mount, but file modification time is updating every time I change the config file, so I have no idea why gatus isn't picking up the changes. In fact, after multiple tests, only one time it has printed |
I found a way to reproduce. tl;dr: this software doesn't play well with vim. Steps to reproduce:
Here's the reason: https://unix.stackexchange.com/a/188954
|
@1player Thanks for the heads up. To answer your question, the person who created the issue is the one who closed it -- but it was somewhat reasonable at the time given that nobody else had reported this issue before. In any case, I tried to reproduce it with my main machine, which runs Windows, to no avail:
But since this is the second person that brings it up, I gave it a shot my laptop which runs Manjaro, and:
This is a pretty weird issue... |
I found the issue: https://stackoverflow.com/a/53548078 My Docker instance of gatus used a bind mount for the config.yaml file, as suggested by the README, as such: As that Stack Overflow link above suggests, bind mounts are based on inodes and when the file is deleted and recreated then the bind-mount is broken, so when vim replaces the original file with the updated one, the inode changes, and the bind mount breaks. If you mount the whole parent directory instead of just the config file ( EDIT: see also moby/moby#6011 |
@1player Great catch! Would you be interested in updating the following examples?:
Basically, it's just adding a (P.S. If you don't want to, no worries - I'll update them. I'm just offering it since you're the one who found the root cause) |
The first one to do it wins! :-) A bit busy atm, if I find a moment to do it, I will push a PR, but if you're in front of the code, go ahead and thanks for taking care of updating the examples. Also perhaps we should update the README, and adding a note why binding the file itself is not the best. |
I added a small note in the README.md for now (see #166), but I'll let you take care of the examples if you don't mind 😄 |
ref: TwiN#151 (comment) update all exmaple in docker-compose file. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
ref: #151 (comment) update all exmaple in docker-compose file. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Step to reproduce:
Change the
name
field in theconfig/config.yaml
.Observation:
In the
HasLoadedConfigurationFileBeenModified
function, the result of the comparison ofconfig.lastFileModTime.Unix() != fileInfo.ModTime().Unix()
is always false.The text was updated successfully, but these errors were encountered: