From owner-svn-src-all@FreeBSD.ORG Mon Aug 23 09:52:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03C7910656A7; Mon, 23 Aug 2010 09:52:05 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E69DF8FC2A; Mon, 23 Aug 2010 09:52:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7N9q4FG034127; Mon, 23 Aug 2010 09:52:04 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7N9q4uq034123; Mon, 23 Aug 2010 09:52:04 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201008230952.o7N9q4uq034123@svn.freebsd.org> From: Brian Somers Date: Mon, 23 Aug 2010 09:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211699 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 09:52:05 -0000 Author: brian Date: Mon Aug 23 09:52:04 2010 New Revision: 211699 URL: http://svn.freebsd.org/changeset/base/211699 Log: MFC r210407: Add a -S switch to override syslogd's pidfile. Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.8 Mon Aug 23 09:52:04 2010 (r211699) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd January 19, 2010 +.Dd July 23, 2010 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -27,6 +27,7 @@ .Nm .Op Fl CFNPnrsv .Op Fl R Ar tagname +.Op Fl S Ar pidfile .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file @@ -215,6 +216,12 @@ Skipping the signal step will also mean will return faster, since .Nm normally waits a few seconds after any signal that is sent. +.It Fl S Ar pidfile +Use +.Ar pidfile +as +.Xr syslogd 8 Ns 's +pidfile. .El .Pp If additional command line arguments are given, Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Aug 23 09:52:04 2010 (r211699) @@ -186,6 +186,8 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ +const char *path_syslogpid = _PATH_SYSLOGPID; + static struct conf_entry *get_worklist(char **files); static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, struct conf_entry **glob_p, struct conf_entry **defconf_p); @@ -632,6 +634,9 @@ parse_args(int argc, char **argv) rotatereq++; requestor = strdup(optarg); break; + case 'S': + path_syslogpid = optarg; + break; case 'm': /* Used by OpenBSD for "monitor mode" */ default: usage(); @@ -724,7 +729,7 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n" - " [ [-R requestor] filename ... ]\n"); + " [-S pidfile] [ [-R requestor] filename ... ]\n"); exit(1); } @@ -1318,7 +1323,7 @@ no_trimat: working->flags &= ~CE_SIGNALGROUP; } if (needroot) - working->pid_file = strdup(_PATH_SYSLOGPID); + working->pid_file = strdup(path_syslogpid); } /* Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Aug 23 06:40:21 2010 (r211698) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Mon Aug 23 09:52:04 2010 (r211699) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd November 27, 2006 +.Dd July 23, 2010 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -315,14 +315,17 @@ process ID or to find a group process ID flag was specified. If this field is present, a .Ar signal_number -is sent the process ID contained in this file. -If this field is not present, then a +is sent to the process ID contained in this file. +If this field is not present and the +.Cm N +flag has not been specified, then a .Dv SIGHUP signal will be sent to -.Xr syslogd 8 , -unless the -.Cm N -flag has been specified. +.Xr syslogd 8 +or to the process id found in the file specified by +.Xr newsyslog 8 Ns 's +.Fl S +switch. This field must start with .Ql / in order to be recognized properly.