Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rsyncd not logging connections? & mailing of log files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jthompson
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 159
Location: Pompano Beach, FL

PostPosted: Tue Jun 13, 2006 2:39 pm    Post subject: rsyncd not logging connections? & mailing of log files Reply with quote

I have a few machines that are using rsync to synchronize some data with one main server. However, when these machines run their rsync command from a cron job, the rsyncd (daemon) on the server does not log the connections. I'm trying to figure out a way that I can check to see whether these machines are updating every night, but checking 25 dead.letter files is annoying.

Here is my rsyncd.conf on the server

Code:
# /etc/rsyncd.conf
# $Header: /var/cvsroot/gentoo-x86/net-misc/rsync/files/rsyncd.conf,v 1.6 2005/03/24 03:12:45 vapier Exp $

# Minimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help

# This line is required by the /etc/init.d/rsyncd script
pid file = /var/run/rsyncd.pid
uid=nobody
gid=nobody
use chroot = yes
read only = yes

#limit access to private LAN's
hosts deny=*
hosts allow=192.168.xxx.0/255.255.255.0 192.192.xxx.0/255.255.255.0

max connections = 30
pid file = /var/run/rsyncd.pid
motd file = /etc/rsync/rsyncd.motd

#This will give you a separate log file
log file = /var/log/rsync.log

#This will log every file transferred - up to 85,000+ per user, per sync
#transfer logging = yes

log format = %t %a %m %f %b
syslog facility = local3
timeout = 300

[gentoo-portage]
#modern versions of portage use this entry
path = /usr/portage
comment = Gentoo Linux Portage tree mirror
exclude = distfiles/

[ben-data]
path = /home/ben.data
comment = QM account BEN.DATA
auth users = ben.data
exclude = .ssh/ .bash_history .bash_logout .bash_profile .bashrc .keychain/ .lesshst .tcsh.config

[qmsys]
path = /usr/qmsys
comment = QM database system
auth users = qmsys
exclude = .ssh/ .bash_history .bash_logout .bash_profile .bashrc .keychain/ .lesshst .tcsh.config

# Simple example for enabling your own local rsync server
#[gentoo-portage]
#       path = /usr/portage
#       comment = Gentoo Linux Portage tree
#       exclude = /distfiles /packages

_________________
I can't remember from noon to lunchtime!


Last edited by jthompson on Tue Jun 13, 2006 5:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Tue Jun 13, 2006 5:31 pm    Post subject: Reply with quote

hmm nothing obvious

- did you try to restart the rsyncd already?
- what gives ls -la /var/log/rsync.log?
- anything logged in /var/log/messages?

about the dead.letters
- configure yours clients cronjobs to use a correct recipient address
- configure yours clients MTA (most probably ssmtp) to use a working mailserver
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
jthompson
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 159
Location: Pompano Beach, FL

PostPosted: Tue Jun 13, 2006 5:57 pm    Post subject: Reply with quote

Quote:
- did you try to restart the rsyncd already?

Yes

ls -la /var/log/messages
Code:

-rw-r--r-- 1 root root 110701 Jun 13 10:18 /var/log/rsync.log


Could it be that since normal users are rsyncing, that it can't write to this log file?

I believe all that gets logged into /var/log/messages are the ssh connections...

Code:
Jun  8 01:15:01 server sshd[1310]: Accepted publickey for ben.data from xxx.xxx.xxx.xxx port xxxxx s$
Jun  8 01:15:01 server sshd(pam_unix)[1315]: session opened for user ben.data by (uid=0)


but no rsync info.

The emerge syncs are getting logged into /var/log/rsync.log, but not the other rsync commands.

Quote:
about the dead.letters
- configure yours clients cronjobs to use a correct recipient address
- configure yours clients MTA (most probably ssmtp) to use a working mailserver


Are you suggesting that I configure cron to write somewhere else besides the dead.letters?
So you're saying use something like mutt to mail out the dead.letters? I was hoping I could get the commands to write to the one rsycnd.log on the server and just mail that to me.

Sorry I'm a bit new at this, I just learn as I go.
_________________
I can't remember from noon to lunchtime!
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Tue Jun 13, 2006 6:54 pm    Post subject: Reply with quote

jthompson wrote:
Could it be that since normal users are rsyncing, that it can't write to this log file?

not sure, i've only a anonymous rsync mirror here to test but that one logs as it should.

Quote:
Are you suggesting that I configure cron to write somewhere else besides the dead.letters?
So you're saying use something like mutt to mail out the dead.letters? I was hoping I could get the commands to write to the one rsycnd.log on the server and just mail that to me.

What i mean would be in easiest case (no auth needed on the mail server etc.)
inside your crontab
MAILTO=user@domain.org # the mail address the cron reports should be send to

inside your /etc/ssmtp/ssmtp.conf
mailhub=mail.domain.org # e.g. yours ISP mail server
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
jthompson
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 159
Location: Pompano Beach, FL

PostPosted: Wed Jun 14, 2006 3:14 pm    Post subject: Reply with quote

Ok so I'm going to try that and see if it works. The config files look like so:

Code:
crontab -l

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (crons.cron installed on Wed Jun 14 10:36:37 2006)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
MAILTO=yomama@gmail.com
#Mins   Hours   Days    Months  Day of the week
15      1       *       *       *       /home/ben.data/sync-qm-bendata.sh


Code:
/etc/ssmtp/ssmtp.conf

#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#

root=postmaster
mailhub=smtp.gmail.com:465
rewriteDomain=
FromLineOverride=YES
UseTLS=YES
AuthUser=yomama
AuthPass=yodaddy


I am not sure of a way to test ssmtp to see it works, so I guess I'll have to wait until tonight.

The only reason that I can see that the rsync commands aren't logging is that those users don't have permission to write to /var/log/rsync.log.

So if I can get your idea to work, then I suppose 25 mails or so every morning isn't that bad of a deal.
_________________
I can't remember from noon to lunchtime!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum