-
Notifications
You must be signed in to change notification settings - Fork 33
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
gluster-block: add logrotate support #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest looks good to me @lxbsz
538a026
to
5771283
Compare
@lxbsz can you please rebase this on current ? |
Sure, will do it later. |
af0b9af
to
dd84e7d
Compare
@pkalever |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lxbsz we cannot watch on /etc/sysconfig. We need to create a new config dir under like /etc/sysconfig/gluster-block/ and then move the conf file under it. Then we can watch on /etc/sysconfig/gluster-block/ directory
HTH
@pkalever So please review. |
@lxbsz This was in my list yesterday, got skipped coz I worked on something else. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lxbsz have left few review suggestions, please take a look. Thanks!
8ee872d
to
cbe7341
Compare
@pkalever Updated it. Thanks. |
9bc7167
to
fb0f7ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lxbsz this series looks much simplified.
Do you want to send below patches in a separate PR ?
- config: logDir add dyn support
- logrotate: update the logdir path whenever it changes
- dyn-cfg: skip resetting options if they match with current
Thanks!
Yeah, let's add this after we resolved the -glfs.log issue. Or the logDir dyn make no sense.
|
Yeah, this is one simple thing to do.
|
As I remembered months ago, after the volume is inited by glfs_init, there will be a problem with this. Thanks. |
I tested this locally (with very few changes to glfs-tests.c ) and it works for me. Thanks! |
Okay, cool. BRs
|
Thanks! |
Sure. #199 |
Sample output: -rw-r--r--. 1 root root 9356 Mar 29 22:36 cmd_history.log Reviewed & Tested-by: Prasanna Kumar Kalever <[email protected]> @lxbsz please update the tags. Also can you consider this patch to be attached as part of this PR: Without this patch the dyn-config logs looks quite clumsy for me. Thanks! |
Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Prasanna Kumar Kalever <[email protected]> Tested-by: Prasanna Kumar Kalever <[email protected]>
Editors (such as vim, nano ..) follow different approaches to save conf file. The two commonly followed techniques are to overwrite the existing file, or to write to a new file (.swp, .tmp ..) and move it to actual file name later. In the later case, the inotify fails, because the file it's been intended to watch no longer exists, as the new file is a different file with just a same name. To handle both the file save approaches mentioned above, it is better we watch the directory and filter for MODIFY events. Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Prasanna Kumar Kalever <[email protected]> Tested-by: Prasanna Kumar Kalever <[email protected]>
Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Prasanna Kumar Kalever <[email protected]> Tested-by: Prasanna Kumar Kalever <[email protected]>
Signed-off-by: Prasanna Kumar Kalever <[email protected]>
Yeah, updated it.
|
@lxbsz Thanks! |
Fixes: issue #164
Signed-off-by: Xiubo Li [email protected]