Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 2010 23:27:42 +0300
From:      Mikolaj Golub <to.my.trociny@gmail.com>
To:        freebsd-fs@freebsd.org
Subject:   hastd: log the process id
Message-ID:  <8639tv6e2p.fsf@kopusha.home.net>

next in thread | raw e-mail | index | archive | help
--=-=-=

Hi,

Currently hastd does not log the process id with each message, although it
might be useful in some cases. And it looks like most of our daemons do this.

The patch below adds pid logging. Also it fixes wrong log message in
secondary.

-- 
Mikolaj Golub


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=hastd.patch

Index: secondary.c
===================================================================
--- secondary.c	(revision 212008)
+++ secondary.c	(working copy)
@@ -556,7 +556,7 @@ recv_thread(void *arg)
 			if (hast_proto_recv_data(res, res->hr_remotein,
 			    hio->hio_nv, hio->hio_data, MAXPHYS) < 0) {
 				secondary_exit(EX_TEMPFAIL,
-				    "Unable to receive reply data");
+				    "Unable to receive request data");
 			}
 		}
 		pjdlog_debug(2, "recv: (%p) Moving request to the disk queue.",
Index: pjdlog.c
===================================================================
--- pjdlog.c	(revision 212008)
+++ pjdlog.c	(working copy)
@@ -57,6 +57,9 @@ pjdlog_mode_set(int mode)
 	assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG);
 
 	pjdlog_mode = mode;
+
+	if (mode == PJDLOG_MODE_SYSLOG)
+		openlog (NULL, LOG_PID, LOG_DAEMON);
 }
 
 /*

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8639tv6e2p.fsf>