Bug 255664

Summary: [patch] syslog.3 - add detail about LOG_PID
Product: Documentation Reporter: P Kern <des.gaufres>
Component: Manual PagesAssignee: Fernando Apesteguía <fernape>
Status: Closed FIXED    
Severity: Affects Many People CC: des.gaufres, doc, fernape
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description P Kern 2021-05-06 17:53:49 UTC

    
Comment 1 P Kern 2021-05-06 17:54:23 UTC
--- syslog.3    2021-05-06 13:46:01.100765000 -0400
+++ syslog.3,more       2021-05-06 13:49:13.380749000 -0400
@@ -162 +162 @@
-this option is enabled by default.
+this option is enabled by default and cannot be disabled.
Comment 2 P Kern 2021-05-06 17:58:37 UTC
yikes. did I mess up this report. sorry.

base for the diff is ...
    https://cgit.freebsd.org/src/tree/lib/libc/gen/syslog.3
Comment 3 Fernando Apesteguía freebsd_committer freebsd_triage 2021-05-10 15:07:19 UTC
According to lib/libc/gen/syslog.c

...
  (void)fprintf(fp, "%s ", LogTag == NULL ? NILVALUE : LogTag);
        /*
         * Provide the process ID regardless of whether LOG_PID has been
         * specified, as it provides valuable information. Many
         * applications tend not to use this, even though they should.
         */
...
Comment 4 P Kern 2021-05-10 15:49:55 UTC
(In reply to Fernando Apesteguía from comment #3)

That's correct.  The relevant lines in syslog.c are ...

	/*
	 * Provide the process ID regardless of whether LOG_PID has been
	 * specified, as it provides valuable information. Many
	 * applications tend not to use this, even though they should.
	 */
	(void)fprintf(fp, "%d ", getpid());

...

Previous to this, LOG_PID was optional.

The man page only states that LOG_PID is now enabled by default for FreeBSD.

Since LOG_PID used to be optional, some (like me) might reasonably expect that it would still be possible to disable LOG_PID.

The above patch is meant to adjust the syslog(3) man page to make it clear that for FreeBSD, LOG_PID is now permanent, that it is no longer optional.

Does that help?
Comment 5 Fernando Apesteguía freebsd_committer freebsd_triage 2021-05-10 20:31:29 UTC
(In reply to P Kern from comment #4)
Sure thing. Thanks!

I created a review: https://reviews.freebsd.org/D30188

Let's see how it goes :-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-05-13 14:32:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=94eb6c42ab4a2e2581e7cde6d8bd7e81c87a4442

commit 94eb6c42ab4a2e2581e7cde6d8bd7e81c87a4442
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2021-05-10 15:20:06 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2021-05-13 14:23:44 +0000

    syslog.3 - Add detail about LOG_PID

    Document that LOG_PID is ignored and can not be disabled.
    This change was made along with the move from RFC 3164 to RFC 5424 log messages.

    PR:     255664
    Reported by:    des.gaufres@gmail.com
    Reviewed by:    gbe, jilles
    Approved by:    gbe (mentor, manpages), jilles

 lib/libc/gen/syslog.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2021-05-13 14:32:33 UTC
Committed,

Thanks!