--no-detach option?

Jeremy Hansen jeremy at xxedgexx.com
Mon Nov 26 10:27:57 EST 2001


Has any work been done to create an option for rsync to send its logging 
output to STDOUT for djb style logging?  This would be a useful option for 
me.  --log-stdout?

Thanks
-jeremy

On Wed, 21 Nov 2001, Jos Backus wrote:

> On Wed, Nov 21, 2001 at 08:54:18AM -0600, Dave Dykstra wrote:
> > Excuse me, I meant to say if stdin in IS a socket.
> 
> That mode of operation is used when running from inetd or tcpserver. Not
> detaching from the parent is useful when one wants the parent (supervise in
> this case) to manage the rsync process instead.
> 
> Here's a patch, based on Max Bowsher's patch. If deemed useful I will supply
> the man patch as well.
> 
> Index: clientserver.c
> ===================================================================
> RCS file: /cvsroot/rsync/clientserver.c,v
> retrieving revision 1.74
> diff -u -r1.74 clientserver.c
> --- clientserver.c	9 Nov 2001 06:58:39 -0000	1.74
> +++ clientserver.c	21 Nov 2001 19:26:45 -0000
> @@ -26,6 +26,7 @@
>  extern int read_only;
>  extern int verbose;
>  extern int rsync_port;
> +extern int no_detach;
>  char *auth_user;
>  int sanitize_paths = 0;
>  
> @@ -500,7 +501,8 @@
>  		return start_daemon(STDIN_FILENO);
>  	}
>  
> -	become_daemon();
> +	if (!no_detach)
> +	    become_daemon();
>  
>  	if (!lp_load(config_file, 1)) {
>  		exit_cleanup(RERR_SYNTAX);
> Index: options.c
> ===================================================================
> RCS file: /cvsroot/rsync/options.c,v
> retrieving revision 1.62
> diff -u -r1.62 options.c
> --- options.c	9 Sep 2001 04:41:14 -0000	1.62
> +++ options.c	21 Nov 2001 19:26:46 -0000
> @@ -55,6 +55,7 @@
>  int am_sender = 0;
>  int recurse = 0;
>  int am_daemon=0;
> +int no_detach = 0;
>  int do_stats=0;
>  int do_progress=0;
>  int keep_partial=0;
> @@ -203,6 +204,7 @@
>    rprintf(F,"     --include-from=FILE     don't exclude patterns listed in FILE\n");
>    rprintf(F,"     --version               print version number\n");  
>    rprintf(F,"     --daemon                run as a rsync daemon\n");  
> +  rprintf(F,"     --no-detach             do not detach from the parent\n");  
>    rprintf(F,"     --address               bind to the specified address\n");  
>    rprintf(F,"     --config=FILE           specify alternate rsyncd.conf file\n");  
>    rprintf(F,"     --port=PORT             specify alternate rsyncd port number\n");
> @@ -285,6 +287,7 @@
>    /* TODO: Should this take an optional int giving the compression level? */
>    {"compress",        'z', POPT_ARG_NONE,   &do_compression},
>    {"daemon",           0,  POPT_ARG_NONE,   &am_daemon},
> +  {"no-detach",        0,  POPT_ARG_NONE,   &no_detach},
>    {"stats",            0,  POPT_ARG_NONE,   &do_stats},
>    {"progress",         0,  POPT_ARG_NONE,   &do_progress},
>    {"partial",          0,  POPT_ARG_NONE,   &keep_partial},
> 
> 

-- 
The trouble with being poor is that it takes up all your time.





More information about the rsync mailing list