Bug 194143 - [PATCH] newsyslog(8): better error reporting
Summary: [PATCH] newsyslog(8): better error reporting
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Many People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-04 18:55 UTC by lyndon
Modified: 2014-10-23 18:52 UTC (History)
1 user (show)

See Also:


Attachments
patch to add filename to error message (438 bytes, patch)
2014-10-04 18:55 UTC, lyndon
no flags Details | Diff
proposed alternative (501 bytes, patch)
2014-10-07 23:14 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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