Check-in [541136d097]
Overview
Comment:Updated to support logging to processes in addition to files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 541136d0972d04dc0dd7317d40e5133e1951aea2
User & Date: rkeene on 2014-02-11 16:50:04
Other Links: manifest | tags
Context
2014-02-11
16:55
Added note about log files check-in: d6e6e6e9c7 user: rkeene tags: trunk
16:50
Updated to support logging to processes in addition to files check-in: 541136d097 user: rkeene tags: trunk
16:45
Updated to create function for opening log file check-in: 5abd6e92c9 user: rkeene tags: trunk
Changes

Modified filed.1 from [5318cedafd] to [85be589e38].

75
76
77
78
79
80
81
82



83
84
85
86
87
88
89
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89
90
91







-
+
+
+







.B -l (or --log)
Specifies a filename to open for writing log entries.  Log
entries are made for various stages in transfering files.
The log file is opened before switching users (see "-u")
and root directories (see "-r").  The log file is never
closed so log rotation without stopping the daemon is will
not work.  The value of "-" indicates that standard output
should be used for logging.
should be used for logging.  If the filename begins with a "|"
then a process is started and used for logging instead of a
file.

.TP
.B -u (or --user)
Specifies the user to switch user IDs to before servicing
requests.  The default is not change user IDs.

.TP

Modified filed.c from [efe5cb96e7] to [c52c45f3be].

433
434
435
436
437
438
439



440
441
442
443
444
445
446
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449







+
+
+







}

static FILE *filed_log_open(const char *file) {
	FILE *retval;

	if (strcmp(file, "-") == 0) {
		retval = stdout;
	} else if (file[0] == '|') {
		file++;
		retval = popen(file, "w");
	} else {
		retval = fopen(file, "a+");
	}

	return(retval);
}

1089
1090
1091
1092
1093
1094
1095
1096



1097
1098
1099
1100
1101
1102
1103
1092
1093
1094
1095
1096
1097
1098

1099
1100
1101
1102
1103
1104
1105
1106
1107
1108







-
+
+
+







		fprintf(output, "\n");
		fprintf(output, "      -l (or --log) specifies a filename to open for writing log entries.  Log\n");
		fprintf(output, "                    entries are made for various stages in transfering files.\n");
		fprintf(output, "                    The log file is opened before switching users (see \"-u\")\n");
		fprintf(output, "                    and root directories (see \"-r\").  The log file is never\n");
		fprintf(output, "                    closed so log rotation without stopping the daemon is will\n");
		fprintf(output, "                    not work.  The value of \"-\" indicates that standard output\n");
		fprintf(output, "                    should be used for logging.  The default is \"%s\".\n", LOG_FILE);
		fprintf(output, "                    should be used for logging.  If the filename begins with a \"|\"\n");
		fprintf(output, "                    then a process is started and used for logging instead of a\n");
		fprintf(output, "                    file.  The default is \"%s\".\n", LOG_FILE);
#ifdef FILED_DONT_LOG
		fprintf(output, "                    Note that logging is completely disabled so this option does\n");
		fprintf(output, "                    nothing in this build.\n");
#endif
		fprintf(output, "\n");
		fprintf(output, "      -u (or --user) specifies the user to switch user IDs to before servicing\n");
		fprintf(output, "                     requests.  The default is not change user IDs.\n");