Date: Sun, 21 Mar 1999 04:07:37 -0700 (MST) From: chad@anasazi.com To: FreeBSD-gnats-submit@freebsd.org Subject: bin/10705: enhancement to "newsyslog" Message-ID: <199903211107.EAA04417@freebie.dcfinc.com>
next in thread | raw e-mail | index | archive | help
>Number: 10705 >Category: bin >Synopsis: enhancement to "newsyslog" >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 21 03:10:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Chad R. Larson >Release: FreeBSD 2.2-STABLE i386 >Organization: DCF, Inc. >Environment: Any 2.2-STABLE system >Description: The current "newsyslog" program is useful for rolling log files other than those run by syslog. But some of those uses do not involve a logging daemon, for example, keeping logs of cvsup operations, or the output of "make". However, newsyslog as now delivered will try to signal some daemon at the conclusion of processing each line in its config file. You can avoid the signal by intentionally creating an invalid "path to pid" file, but that is a kludge and you have to put up with error messages. >How-To-Repeat: >Fix: I've added another option switch to the command line of newsyslog that supresses the attempt to send a signal. Here are patches... -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= *** newsyslog.8.old Sun Mar 21 03:50:41 1999 --- newsyslog.8 Sun Mar 21 03:51:18 1999 *************** *** 1,7 **** .\" This file contains changes from the Open Software Foundation. .\" .\" from: @(#)newsyslog.8 ! .\" $Id: newsyslog.8,v 1.1 1999/03/19 21:35:16 toor Exp $ .\" .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology .\" --- 1,7 ---- .\" This file contains changes from the Open Software Foundation. .\" .\" from: @(#)newsyslog.8 ! .\" $Id: newsyslog.8,v 1.2 1999/03/19 23:52:10 toor Exp $ .\" .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology .\" *************** *** 25,31 **** .Nd maintain system log files to manageable sizes .Sh SYNOPSIS .Nm newsyslog ! .Op Fl Fnrv .Op Fl f Ar config_file .Sh DESCRIPTION .Nm Newsyslog --- 25,31 ---- .Nd maintain system log files to manageable sizes .Sh SYNOPSIS .Nm newsyslog ! .Op Fl Fnrsv .Op Fl f Ar config_file .Sh DESCRIPTION .Nm Newsyslog *************** *** 149,154 **** --- 149,158 ---- .Nm not to trim the logs, but to print out what it would do if this option were not specified. + .It Fl s + Tell + .Nm + not to attempt to signal any daemon. .It Fl r Remove the restriction that .Nm *** newsyslog.c.old Sun Mar 21 03:57:51 1999 --- newsyslog.c Sun Mar 21 03:51:18 1999 *************** *** 27,33 **** #ifndef lint static const char rcsid[] = ! "$Id: newsyslog.c,v 1.1 1999/03/19 21:35:16 toor Exp $"; #endif /* not lint */ #ifndef CONF --- 27,33 ---- #ifndef lint static const char rcsid[] = ! "$Id: newsyslog.c,v 1.3 1999/03/21 10:45:25 chad Exp $"; #endif /* not lint */ #ifndef CONF *************** *** 90,95 **** --- 90,96 ---- int verbose = 0; /* Print out what's going on */ int needroot = 1; /* Root privs are necessary */ int noaction = 0; /* Don't do anything, just show it */ + int nokill = 0; /* Don't signal the syslog daemon */ int force = 0; /* Force the trim no matter what*/ char *conf = CONF; /* Configuration file to use */ time_t timenow; *************** *** 218,223 **** --- 219,227 ---- case 'r': needroot = 0; break; + case 's': + nokill++; + break; case 'v': verbose++; break; *************** *** 234,240 **** static void usage() { ! fprintf(stderr, "usage: newsyslog [-Fnrv] [-f config-file]\n"); exit(1); } --- 238,244 ---- static void usage() { ! fprintf(stderr, "usage: newsyslog [-Fnrsv] [-f config-file]\n"); exit(1); } *************** *** 523,531 **** pid = 0; need_notification = notified = 0; ! if (pid_file != NULL) { ! need_notification = 1; ! pid = get_pid(pid_file); } if (pid) { --- 527,537 ---- pid = 0; need_notification = notified = 0; ! if (nokill == 0) { ! if (pid_file != NULL) { ! need_notification = 1; ! pid = get_pid(pid_file); ! } } if (pid) { -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903211107.EAA04417>