Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dhcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
69
Issues
69
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
dhcp
Commits
bfcfc9ca
Commit
bfcfc9ca
authored
May 07, 2014
by
Shawn Routhier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[v4_1_esv] Add configure option to incude PID in syslog entries
parent
51406f4b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
5 deletions
+47
-5
RELNOTES
RELNOTES
+6
-0
client/dhclient.c
client/dhclient.c
+1
-1
configure
configure
+16
-0
configure.ac
configure.ac
+10
-0
dhcpctl/omshell.c
dhcpctl/omshell.c
+1
-1
includes/config.h.in
includes/config.h.in
+3
-0
includes/dhcpd.h
includes/dhcpd.h
+7
-0
relay/dhcrelay.c
relay/dhcrelay.c
+1
-1
server/dhcpd.c
server/dhcpd.c
+2
-2
No files found.
RELNOTES
View file @
bfcfc9ca
...
...
@@ -118,6 +118,12 @@ by Eric Young (eay@cryptsoft.com).
Thanks
to
Tomas
Hozza
at
Red
Hat
for
the
suggestion
and
a
prototype
fix
.
[
ISC
-
Bugs
#
33098
]
-
Add
the
"enable-log-pid"
option
to
the
configure
script
.
When
enabled
this
causes
the
client
,
server
and
relay
programs
to
include
the
PID
number
in
syslog
messages
.
Thanks
to
Marius
Tomaschewski
for
the
suggestion
and
proto
-
patch
.
[
ISC
-
Bugs
#
29713
]
Changes
since
4.1
-
ESV
-
R9rc1
-
None
...
...
client/dhclient.c
View file @
bfcfc9ca
...
...
@@ -138,7 +138,7 @@ main(int argc, char **argv) {
else
if
(
fd
!=
-
1
)
close
(
fd
);
openlog
(
"dhclient"
,
LOG_NDELAY
,
LOG_DAEMON
);
openlog
(
"dhclient"
,
DHCP_LOG_OPTIONS
,
LOG_DAEMON
);
#if !(defined(DEBUG) || defined(__CYGWIN32__))
setlogmask
(
LOG_UPTO
(
LOG_INFO
));
...
...
configure
View file @
bfcfc9ca
...
...
@@ -745,6 +745,7 @@ enable_early_chroot
enable_ipv4_pktinfo
enable_use_sockets
enable_secs_byteorder
enable_log_pid
with_atf
with_srv_lease_file
with_srv6_lease_file
...
...
@@ -1410,6 +1411,7 @@ Optional Features:
--enable-use-sockets use the standard BSD socket API (default is no)
--enable-secs-byteorder Correct bad byteorders in the secs field (default is
no).
--enable-log-pid Include PIDs in syslog messages (default is no).
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
...
...
@@ -5391,6 +5393,20 @@ $as_echo "#define SECS_BYTEORDER 1" >>confdefs.h
fi
# Include the PID in the log messages. This is useful when there may be multiple
# instances of a program.
# This is off by default
# Check whether --enable-log_pid was given.
if
test
"
${
enable_log_pid
+set
}
"
=
set
;
then
:
enableval
=
$enable_log_pid
;
fi
if
test
"
$enable_log_pid
"
=
"yes"
;
then
$as_echo
"#define USE_LOG_PID 1"
>>
confdefs.h
fi
# Testing section
atf_path
=
"no"
...
...
configure.ac
View file @
bfcfc9ca
...
...
@@ -182,6 +182,16 @@ if test "$enable_secs_byteorder" = "yes" ; then
[Define to correct bad byteorders in secs field.])
fi
# Include the PID in the log messages. This is useful when there may
# be multiple instances of a program.
# This is off by default
AC_ARG_ENABLE(log_pid,
AS_HELP_STRING([--enable-log-pid],[Include PIDs in syslog messages (default is no).]))
if test "$enable_log_pid" = "yes" ; then
AC_DEFINE([USE_LOG_PID], [1],
[Define to include PIDs in syslog messages.])
fi
# Testing section
atf_path="no"
...
...
dhcpctl/omshell.c
View file @
bfcfc9ca
...
...
@@ -100,7 +100,7 @@ main(int argc, char **argv) {
}
/* Initially, log errors to stderr as well as to syslogd. */
openlog
(
"omshell"
,
LOG_NDELAY
,
DHCPD_LOG_FACILITY
);
openlog
(
"omshell"
,
DHCP_LOG_OPTIONS
,
DHCPD_LOG_FACILITY
);
status
=
dhcpctl_initialize
();
if
(
status
!=
ISC_R_SUCCESS
)
{
fprintf
(
stderr
,
"dhcpctl_initialize: %s
\n
"
,
...
...
includes/config.h.in
View file @
bfcfc9ca
...
...
@@ -148,6 +148,9 @@
/* Define to include server activity tracing support. */
#undef TRACING
/* Define to include PIDs in syslog messages. */
#undef USE_LOG_PID
/* Define to 1 to use the standard BSD socket API. */
#undef USE_SOCKETS
...
...
includes/dhcpd.h
View file @
bfcfc9ca
...
...
@@ -1357,6 +1357,13 @@ typedef unsigned char option_mask [16];
* Used to silence static analysers warnings about unused results.
*/
#define POST(x) ((void)(x))
#endif
#ifdef USE_LOG_PID
/* include the pid in the syslog messages */
#define DHCP_LOG_OPTIONS LOG_NDELAY | LOG_PID
#else
#define DHCP_LOG_OPTIONS LOG_NDELAY
#endif
/* these are referenced */
...
...
relay/dhcrelay.c
View file @
bfcfc9ca
...
...
@@ -188,7 +188,7 @@ main(int argc, char **argv) {
else
if
(
fd
!=
-
1
)
close
(
fd
);
openlog
(
"dhcrelay"
,
LOG_NDELAY
,
LOG_DAEMON
);
openlog
(
"dhcrelay"
,
DHCP_LOG_OPTIONS
,
LOG_DAEMON
);
#if !defined(DEBUG)
setlogmask
(
LOG_UPTO
(
LOG_INFO
));
...
...
server/dhcpd.c
View file @
bfcfc9ca
...
...
@@ -299,7 +299,7 @@ main(int argc, char **argv) {
dhcp_common_objects_setup
();
/* Initially, log errors to stderr as well as to syslogd. */
openlog
(
"dhcpd"
,
LOG_NDELAY
,
DHCPD_LOG_FACILITY
);
openlog
(
"dhcpd"
,
DHCP_LOG_OPTIONS
,
DHCPD_LOG_FACILITY
);
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
strcmp
(
argv
[
i
],
"-p"
))
{
...
...
@@ -1064,7 +1064,7 @@ void postconf_initialization (int quiet)
&
global_scope
,
oc
,
MDL
))
{
if
(
db
.
len
==
1
)
{
closelog
();
openlog
(
"dhcpd"
,
LOG_NDELAY
,
db
.
data
[
0
]);
openlog
(
"dhcpd"
,
DHCP_LOG_OPTIONS
,
db
.
data
[
0
]);
/* Log the startup banner into the new
log file. */
if
(
!
quiet
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment