rsyncd log file option and logrotate
Greets. I'm running rsyncd out of xinetd and will be logging to /var/log/rsyncd.log. Is there anything special I need to do with rsync if I use logrotate to manage the rsyncd.log files? Do I need to 'restart' the rsyncd process if one is running and the log gets rotated? -- Regards, Scott Russell ([EMAIL PROTECTED]) Linux Technology Center, System Admin, RHCE. T/L 441-9289 / External 919-543-9289 http://bzimage.raleigh.ibm.com/webcam
Re: rsyncd log file option and logrotate
On Wed, Jun 13, 2001 at 04:03:11PM -0400, Scott Russell wrote: Greets. I'm running rsyncd out of xinetd and will be logging to /var/log/rsyncd.log. Is there anything special I need to do with rsync if I use logrotate to manage the rsyncd.log files? Do I need to 'restart' the rsyncd process if one is running and the log gets rotated? I haven't used logrotate, but modified rsync some time ago to have it close and re-open the log file on every connection, to allow the log file to be moved away when running as a stand-alone background daemon. When running from xinetd you're re-starting rsync completely on every connection so it would have worked even without my modification. Each individual connection is pretty short lived so you shouldn't have to worry about any running rsync daemon processes. Are you having a problem? - Dave Dykstra
Re: rsyncd log file option and logrotate
David - No, no problem, yet. Just trying to avoid problems. :) I think the question really boils down to what happens if the logfile rsyncd is writing to gets moved out from under it? Maybe I should just run rsyncd in standalone mode and use /sbin/kill -HUP to restart it after moving the logfile. -- Scott On Wed, Jun 13, 2001 at 03:32:49PM -0500, Dave Dykstra wrote: On Wed, Jun 13, 2001 at 04:03:11PM -0400, Scott Russell wrote: Greets. I'm running rsyncd out of xinetd and will be logging to /var/log/rsyncd.log. Is there anything special I need to do with rsync if I use logrotate to manage the rsyncd.log files? Do I need to 'restart' the rsyncd process if one is running and the log gets rotated? I haven't used logrotate, but modified rsync some time ago to have it close and re-open the log file on every connection, to allow the log file to be moved away when running as a stand-alone background daemon. When running from xinetd you're re-starting rsync completely on every connection so it would have worked even without my modification. Each individual connection is pretty short lived so you shouldn't have to worry about any running rsync daemon processes. Are you having a problem? - Dave Dykstra -- Regards, Scott Russell ([EMAIL PROTECTED]) Linux Technology Center, System Admin, RHCE. T/L 441-9289 / External 919-543-9289 http://bzimage.raleigh.ibm.com/webcam
Re: rsyncd log file option and logrotate
On Wed, Jun 13, 2001 at 04:38:52PM -0400, Scott Russell wrote: David - No, no problem, yet. Just trying to avoid problems. :) I think the question really boils down to what happens if the logfile rsyncd is writing to gets moved out from under it? If it is during an open connection, it will keep the old file open from wherever it is moved to and write out there. That's assuming it's the same filesystem; if it's a different filesystem, the move will unlink it from the old filesystem and rsync will keep the inode open until finished and the inode will go away when rsync is done. Anything rsync writes out to the log file after the move (which actually did a copy) would get lost. If the rsync daemon and the process that moves the log file are on different machines sharing over NFS, then rsync would probably get a write error because the inode would have disappeared. Maybe I should just run rsyncd in standalone mode and use /sbin/kill -HUP to restart it after moving the logfile. Why do that? A kill -HUP will not restart rsync --daemon automatically, it will just kill it. - Dave Dykstra
Re: rsyncd log file option and logrotate
On Wed, Jun 13, 2001 at 03:54:31PM -0500, Dave Dykstra wrote: On Wed, Jun 13, 2001 at 04:38:52PM -0400, Scott Russell wrote: David - No, no problem, yet. Just trying to avoid problems. :) I think the question really boils down to what happens if the logfile rsyncd is writing to gets moved out from under it? If it is during an open connection, it will keep the old file open from wherever it is moved to and write out there. That's assuming it's the same filesystem; This is good news. Based on this a logrotate script like should work: /var/log/rsyncd.log { rotate 6 monthly compress missingok } -- Regards, Scott Russell ([EMAIL PROTECTED]) Linux Technology Center, System Admin, RHCE. T/L 441-9289 / External 919-543-9289 http://bzimage.raleigh.ibm.com/webcam