Skip to content
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

proposal - reload config file on save #1176

Open
YanB25 opened this issue Apr 4, 2019 · 6 comments
Open

proposal - reload config file on save #1176

YanB25 opened this issue Apr 4, 2019 · 6 comments
Labels

Comments

@YanB25
Copy link

YanB25 commented Apr 4, 2019

abstract

I'd like to contribute to this project by adding a new feature. I wish to support reloading the config files automatically on save.

details

Users can enable this feature in frpc.ini

reload_on_save = true

and whenever the config file is written, a reload is automatically triggered.

implementation details

I would use https://github.com/fsnotify/fsnotify(Cross-platform file system notifications for Go) to watch the config files and use go's channel to pass the information asynchronously.

motivation

It's more natural for users (including me) to ssh to the client and change the config file. AdminUI is great but ssh is better.
A reload on save would be helpful.

@fatedier
Copy link
Owner

fatedier commented Apr 4, 2019

I'm glad for your upcoming contribution.

Can we use reload_on_update instead of reload_on_save ?

The repo https://github.com/fsnotify/fsnotify maybe has some problem on macos like missing some events.

@fatedier fatedier added the todo label Apr 4, 2019
@YanB25
Copy link
Author

YanB25 commented Apr 5, 2019

Can we use reload_on_update instead of reload_on_save ?

Okay.

The repo https://github.com/fsnotify/fsnotify maybe has some problem on macos like missing some events.

The repo has some problems causing extra events on files (this issue). Users may find extra reload triggered in the log file. I couldn't find a stable library to watch a file on MacOS currently.

If extra reloads on MacOS is not acceptable, maybe we have to close this issue.

@fatedier
Copy link
Owner

fatedier commented Apr 5, 2019

Double events is ok. The problem is missing events.

You can try to test it or at least reload conf at a fixed interval ?

@YanB25
Copy link
Author

YanB25 commented Apr 6, 2019

You can try to test it or at least reload conf at a fixed interval ?

Yes, I can get the last modified time at a fixed interval and reload on necessary, if you prefer to use polling.

The problem is missing events.

I go through the issues and only find this one related to losing events. There's no further information about it. Only double events bug is confirmed.

BTW, I have MacOS environment and I can have a test about it if necessary.

@fatedier
Copy link
Owner

@YanB25 No progress?

@zyfdegh
Copy link

zyfdegh commented Jan 2, 2020

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants