rotating lsyncd.log?

1,088 views
Skip to first unread message

Frank Dana

unread,
Nov 16, 2017, 5:29:28 PM11/16/17
to lsyncd
I'm using lsyncd logging to its own lsyncd.log file, which can get rather sizeable (I just thought to check for the first time in a while and noticed that its current size was > 100MB), so I wanted to start managing that file using logrotate.

However, after looking over the docs at https://axkibe.github.io/lsyncd/ and searching this group for previous discussion, I couldn't find any information about log-rotation facilities in lsyncd. Is there a way to signal the running lsyncd process that its logfile has been rotated (sending the process a HUP signal is a popular method), so that it will close its output logfile and reopen it to the new one?

I can always use logrotate's "copytruncate" config directive to have it steal the logs out from under lsyncd without its knowledge, if necessary, but I thought I'd look into a more participatory method. Thanks!

Axel Kittenberger

unread,
Nov 16, 2017, 5:40:57 PM11/16/17
to lsyncd
Lsyncd closes the logfile handle after each write exactly out of this reason. You can rotate it "under it's feet" without any issues.




--
You received this message because you are subscribed to the Google Groups "lsyncd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lsyncd+unsubscribe@googlegroups.com.
To post to this group, send email to lsy...@googlegroups.com.
Visit this group at https://groups.google.com/group/lsyncd.
For more options, visit https://groups.google.com/d/optout.

FeRD

unread,
Nov 16, 2017, 5:59:00 PM11/16/17
to lsy...@googlegroups.com
Perfect! Thanks.

--
You received this message because you are subscribed to a topic in the Google Groups "lsyncd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lsyncd/M3pXt9UfnHw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lsyncd+unsubscribe@googlegroups.com.

su...@valtix.com

unread,
Apr 6, 2019, 12:08:41 PM4/6/19
to lsyncd
Axel,

Sorry for awakening an old post. Wouldn't opening/closing stream on each write kill the performance even on a low to moderately chatty sync? Why not just handle the HUP (or USR1) and close & reopen?

Thx,
-Sunil

On Thursday, November 16, 2017 at 2:40:57 PM UTC-8, Axel Kittenberger wrote:
Lsyncd closes the logfile handle after each write exactly out of this reason. You can rotate it "under it's feet" without any issues.



On Thu, Nov 16, 2017 at 11:29 PM, Frank Dana <fer...@gmail.com> wrote:
I'm using lsyncd logging to its own lsyncd.log file, which can get rather sizeable (I just thought to check for the first time in a while and noticed that its current size was > 100MB), so I wanted to start managing that file using logrotate.

However, after looking over the docs at https://axkibe.github.io/lsyncd/ and searching this group for previous discussion, I couldn't find any information about log-rotation facilities in lsyncd. Is there a way to signal the running lsyncd process that its logfile has been rotated (sending the process a HUP signal is a popular method), so that it will close its output logfile and reopen it to the new one?

I can always use logrotate's "copytruncate" config directive to have it steal the logs out from under lsyncd without its knowledge, if necessary, but I thought I'd look into a more participatory method. Thanks!

--
You received this message because you are subscribed to the Google Groups "lsyncd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lsy...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages