Bug 1369452 - No way to gracefully rotate the libgfapi Samba vfs_glusterfs logfile.
Summary: No way to gracefully rotate the libgfapi Samba vfs_glusterfs logfile.
Keywords:
Status: CLOSED EOL
Alias: None
Product: GlusterFS
Classification: Community
Component: libgfapi
Version: 3.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On: 1187296 1369453
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-23 13:01 UTC by hari gowtham
Modified: 2017-11-07 10:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1187296
Environment:
Last Closed: 2017-11-07 10:42:24 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description hari gowtham 2016-08-23 13:01:21 UTC
+++ This bug was initially created as a clone of Bug #1187296 +++

No way to gracefully rotate the libgfapi vfs_glusterfs logfile.

There is no way to gracefully rotate the libgfapi
Samba vfs_glusterfs glusterfs:logfile=<my_log_file>.

Nothing works other than a full restart of the 'smbd' service,
which negatively affects all shares, which is not ideal.

This is the case with the latest available versions, GlusterFS
3.6.2, and Samba 4.1.16.

--- Additional comment from Niels de Vos on 2015-02-10 07:26:42 EST ---

We have to think about providing something like an API to enable rotating the logs in a usable way. I agree that stopping/starting an application that uses libgfapi (like samba) is not acceptable.

When we have defined and implemented an API for this, we need to inform the Samba community about this new functionality.

Shyam, are you interested in looking into this, or shall I do that?

--- Additional comment from Shyamsundar on 2015-02-10 07:57:16 EST ---

Let me take a stab at it. Assigned to myself.

--- Additional comment from Shyamsundar on 2015-02-10 11:08:43 EST ---

Current situation:
The regular gluster deamons, use SIGHUP to get notified on log rotations, so when the logrotate cron job runs, it notifies glusterfs(d), glusterd, et. al. via a HUP to close the old fd/FILE and open a new one. logrotate in the background has already renamed the file to its backup name etc.

gfapi cannot override HUP as it is being used by another service and is not a deamon buy itself. As a result, there is no way currently to notify gfapi that a log rotation has been performed.

Here are the options for gfapi consumers:

1) Add a logrotate entry for the log file that is configured via SAMBA (or any other service that uses gfapi) with the copytruncate flag in the rotate command.

copytruncate, will let the deamon operate on the same fd/FILE whereas copy the old contents and truncate the original file, as a result we achieve rotation.

@Jeff, possibly even academic, but could you try this option? If not, just remove the NEEDINFO flag against yourself.

2) Provide an API that the consumer of gfapi can call, to gracefully rotate logs, and consumer would need to handle when this API is called (say in their HUP signal handler).

This requires changes (as stated by Niels) in gfapi and its consumers.

--- Additional comment from Jeff Byers on 2015-02-10 12:06:04 EST ---

(In reply to Shyamsundar from comment #3)
> Current situation:
> The regular gluster deamons, use SIGHUP to get notified on log rotations, so
> when the logrotate cron job runs, it notifies glusterfs(d), glusterd, et.
> al. via a HUP to close the old fd/FILE and open a new one. logrotate in the
> background has already renamed the file to its backup name etc.
> 
> gfapi cannot override HUP as it is being used by another service and is not
> a deamon buy itself. As a result, there is no way currently to notify gfapi
> that a log rotation has been performed.
> 
> Here are the options for gfapi consumers:
> 
> 1) Add a logrotate entry for the log file that is configured via SAMBA (or
> any other service that uses gfapi) with the copytruncate flag in the rotate
> command.
> 
> copytruncate, will let the deamon operate on the same fd/FILE whereas copy
> the old contents and truncate the original file, as a result we achieve
> rotation.
> 
> @Jeff, possibly even academic, but could you try this option? If not, just
> remove the NEEDINFO flag against yourself.
> 
> 2) Provide an API that the consumer of gfapi can call, to gracefully rotate
> logs, and consumer would need to handle when this API is called (say in
> their HUP signal handler).
> 
> This requires changes (as stated by Niels) in gfapi and its consumers.

I did not use logrotate, but performed the test manually by hand. The
logrodate copytruncate option (or the functional equivalent) should
work fine. This implies that there is no logfile offset knowledge, or
seeking within the logfile, other than to the EOF, which seems likely.
Thanks.

Comment 1 Niels de Vos 2016-09-12 05:37:24 UTC
All 3.8.x bugs are now reported against version 3.8 (without .x). For more information, see http://www.gluster.org/pipermail/gluster-devel/2016-September/050859.html

Comment 2 Niels de Vos 2017-11-07 10:42:24 UTC
This bug is getting closed because the 3.8 version is marked End-Of-Life. There will be no further updates to this version. Please open a new bug against a version that still receives bugfixes if you are still facing this issue in a more current release.


Note You need to log in before you can comment on or make changes to this bug.