Hi, When I have my rsync daemon running, I get all log messages in a custom format in the file /var/log/rsyncd.log. This is very convenient as I can cron a script to grep it and mail me a summary of activity every day and then create a fresh file. I have now switched to using rsync over ssh, so I stopped the rsync daemon, and every user has an authorised ssh key and a *custom* rsyncd.conf (with only his or her modules) in each home directory. Each home directory also has a secrets file for the modules of that user. It seems to be working fine overall. I have lost the ability to chroot, but that I understand and accept. What is bothering me is that I lost the ability to write in any file other than syslog (/var/log/messages), so my rsync logs are interleaved with all the system logs .. cannot create a new file everyday etc... I have tried several options, but rsync over ssh just wants to log into syslog. Is it possible to have a custom log file as with the daemon running? Thanks Julian -------------- next part -------------- HTML attachment scrubbed and removed
On Fri, 2006-03-31 at 18:11 +0200, Julian Pace Ross wrote:> every user has an authorised ssh key and a *custom* rsyncd.conf (with > only his or her modules) in each home directory. > > I have tried several options, but rsync over ssh just wants to log > into syslog. > Is it possible to have a custom log file as with the daemon running?Note the following from rsyncd.conf(5): log file The "log file" option tells the rsync daemon to log messages to that file rather than using syslog. This is particularly useful on systems (such as AIX) where syslog() doesn?t work for chrooted programs. If the daemon fails to open to specified file, it will fall back to using syslog and output an error about the failure. (Note that a failure to open the specified log file used to be a fatal error.) I bet your per-user rsyncd.conf files specify /var/log/rsyncd.conf but the individual users don't have permission to write to this log file. Thus the individual rsyncs get EACCES and fall back to syslog. To fix this, you can either grant everyone permission to write to /var/log/rsyncd.log (might not be a good idea because one user could maliciously alter the other user's log messages) or create per-user log files and specify their locations in the per-user rsyncd.confs. -- Matt McCutchen hashproduct@verizon.net http://hashproduct.metaesthetics.net/
On Fri, Mar 31, 2006 at 06:11:38PM +0200, Julian Pace Ross wrote:> What is bothering me is that I lost the ability to write in any file other > than syslog (/var/log/messages)A single-use daemon can write its own logfile; it just needs write- permissions on the file, or it will fallback on using syslog. You may want to have each user log to their own file.> so my rsync logs are interleaved with all > the system logs .. cannot create a new file everyday etc...Syslog has options to route particular messages to particular files. I use the rsync daemon parameter "syslog facility = user" combined with the stock syslog setting of "user.* -/var/log/user.log" to ensure that the rsync daemon messages end up in /var/log/user.log. You could create a similar setup to have the message end up in whatever file you like. ..wayne..
On Fri, Mar 31, 2006 at 06:11:38PM +0200, Julian Pace Ross wrote:> What is bothering me is that I lost the ability to write in any file > other than syslog (/var/log/messages)The problem turned out to be that a new "connect ..." message was getting output in the wrong spot. The attached patch fixes this. Thanks for letting us know about this! ..wayne.. -------------- next part -------------- --- clientserver.c 24 Feb 2006 01:56:26 -0000 1.177 +++ clientserver.c 31 Mar 2006 17:36:26 -0000 @@ -733,8 +733,6 @@ int start_daemon(int f_in, int f_out) char *host = client_name(f_in); int i; - rprintf(FLOG, "connect from %s (%s)\n", host, addr); - io_set_sock_fds(f_in, f_out); if (!lp_load(config_file, 0)) @@ -742,6 +740,8 @@ int start_daemon(int f_in, int f_out) log_init(); + rprintf(FLOG, "connect from %s (%s)\n", host, addr); + if (!am_server) { set_socket_options(f_in, "SO_KEEPALIVE"); if (sockopts)
OK! ... will recompile and fire-up. Thanks Wayne On 31/03/06, Wayne Davison <wayned@samba.org> wrote:> > On Fri, Mar 31, 2006 at 06:11:38PM +0200, Julian Pace Ross wrote: > > What is bothering me is that I lost the ability to write in any file > > other than syslog (/var/log/messages) > > The problem turned out to be that a new "connect ..." message was > getting output in the wrong spot. The attached patch fixes this. > Thanks for letting us know about this! > > ..wayne.. > > >-------------- next part -------------- HTML attachment scrubbed and removed
Seemingly Similar Threads
- merge rsync+ into rsync (was Re: rsync-2.4.7 NEWS file)
- request: add TCP buffer options to rsync CLI?
- group change causing failure
- rsync error using ssh : @ERROR: access denied to server.domain.com from unknown (0.0.0.0) {Scanned By MailScanner}
- [PATCH] build fix without iconv support