Bug 194143

Summary: [PATCH] newsyslog(8): better error reporting
Product: Base System Reporter: lyndon
Component: binAssignee: Mark Johnston <markj>
Status: Closed FIXED    
Severity: Affects Many People CC: markj
Priority: Normal    
Version: 10.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to add filename to error message
none
proposed alternative none

Description lyndon 2014-10-04 18:55:55 UTC
Created attachment 147978 [details]
patch to add filename to error message

When newsyslog receives an error when signalling a process, the resulting error message provides no information to to identify which entry in newsyslog.conf failed.

The attached patch adds the name of the pid file to the error message, to aid in identifying the problematic entry.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2014-10-07 23:14:16 UTC
Created attachment 148083 [details]
proposed alternative

Thanks for the patch. I reworked it slightly: sw_fname is not a pointer and thus does not need to be checked for NULL. I also changed the message to use the same wording as a similar printf below.
Comment 2 lyndon 2014-10-07 23:37:47 UTC
> Thanks for the patch. I reworked it slightly: sw_fname is not a pointer and
> thus does not need to be checked for NULL. 

Doh!  Thanks for catching that.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-08 17:44:36 UTC
A commit references this bug:

Author: markj
Date: Wed Oct  8 17:44:31 UTC 2014
New revision: 272763
URL: https://svnweb.freebsd.org/changeset/base/272763

Log:
  If we fail to send a signal after rotation, print the pidfile from which
  the corresponding PID was obtained.

  PR:		194143
  Submitted by:	Lyndon Nerenberg <lyndon@orthanc.ca>
  MFC after:	1 week

Changes:
  head/usr.sbin/newsyslog/newsyslog.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-10-23 18:49:38 UTC
A commit references this bug:

Author: markj
Date: Thu Oct 23 18:48:44 UTC 2014
New revision: 273553
URL: https://svnweb.freebsd.org/changeset/base/273553

Log:
  MFC 272763:
  If we fail to send a signal after rotation, print the pidfile from which
  the corresponding PID was obtained.

  PR:           194143

Changes:
_U  stable/9/usr.sbin/newsyslog/
  stable/9/usr.sbin/newsyslog/newsyslog.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-10-23 18:51:39 UTC
A commit references this bug:

Author: markj
Date: Thu Oct 23 18:50:45 UTC 2014
New revision: 273554
URL: https://svnweb.freebsd.org/changeset/base/273554

Log:
  MFC r272763:
  If we fail to send a signal after rotation, print the pidfile from which
  the corresponding PID was obtained.

  PR:           194143

Changes:
_U  stable/10/
  stable/10/usr.sbin/newsyslog/newsyslog.c