From d4e40395312350bb8051cab342b3ba784a0cbee2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 14 2014 11:16:16 +0000 Subject: import dhcp-4.2.5-27.el7_0.1 --- diff --git a/SOURCES/dhcp-4.2.5-centos-branding.patch b/SOURCES/dhcp-4.2.5-centos-branding.patch deleted file mode 100644 index f3e7113..0000000 --- a/SOURCES/dhcp-4.2.5-centos-branding.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -uNrp dhcp-4.1.1-P1.orig/omapip/errwarn.c dhcp-4.1.1-P1/omapip/errwarn.c ---- dhcp-4.1.1-P1.orig/omapip/errwarn.c 2012-08-15 14:04:33.149141000 +0000 -+++ dhcp-4.1.1-P1/omapip/errwarn.c 2012-08-15 14:13:05.582416057 +0000 -@@ -81,8 +81,8 @@ void log_fatal (const char * fmt, ... ) - log_error ("have been made to the base software release in order to make"); - log_error ("it work better with this distribution."); - log_error ("%s", ""); -- log_error ("Please report for this software via the Red Hat Bugzilla site:"); -- log_error (" http://bugzilla.redhat.com"); -+ log_error ("Please report for this software via the CentOS Bugs Database:"); -+ log_error (" http://bugs.centos.org/"); - log_error ("%s", ""); - log_error ("exiting."); - #endif diff --git a/SOURCES/dhcp-sd-daemon.patch b/SOURCES/dhcp-sd-daemon.patch new file mode 100644 index 0000000..88c6cd4 --- /dev/null +++ b/SOURCES/dhcp-sd-daemon.patch @@ -0,0 +1,80 @@ +diff -up dhcp-4.2.5/configure.ac.sd-daemon dhcp-4.2.5/configure.ac +--- dhcp-4.2.5/configure.ac.sd-daemon 2014-07-07 12:13:21.474322606 +0200 ++++ dhcp-4.2.5/configure.ac 2014-07-07 12:16:11.320964893 +0200 +@@ -714,6 +714,17 @@ if test x$ldap = xyes || test x$ldapcryp + fi + fi + ++AC_ARG_WITH(systemd, ++ AC_HELP_STRING([--with-systemd], ++ [enable sending status notifications to systemd daemon (default is no)]), ++ [systemd=$withval], ++ [systemd=no]) ++ ++if test x$systemd = xyes ; then ++ AC_CHECK_LIB(systemd-daemon, sd_notify, , ++ AC_MSG_FAILURE([*** sd-daemon library not present - do you need to install systemd-libs package?])) ++fi ++ + # Append selected warning levels to CFLAGS before substitution (but after + # AC_TRY_COMPILE & etc). + CFLAGS="$CFLAGS $STD_CWARNINGS" +diff -up dhcp-4.2.5/relay/dhcrelay.c.sd-daemon dhcp-4.2.5/relay/dhcrelay.c +--- dhcp-4.2.5/relay/dhcrelay.c.sd-daemon 2014-07-07 12:13:21.329324619 +0200 ++++ dhcp-4.2.5/relay/dhcrelay.c 2014-07-07 12:13:21.475322592 +0200 +@@ -41,6 +41,10 @@ + int keep_capabilities = 0; + #endif + ++#ifdef HAVE_LIBSYSTEMD_DAEMON ++#include ++#endif ++ + TIME default_lease_time = 43200; /* 12 hours... */ + TIME max_lease_time = 86400; /* 24 hours... */ + struct tree_cache *global_options[256]; +@@ -608,6 +612,14 @@ main(int argc, char **argv) { + } + #endif + ++#ifdef HAVE_LIBSYSTEMD_DAEMON ++ /* We are ready to process incomming packets. Let's notify systemd */ ++ sd_notifyf(0, "READY=1\n" ++ "STATUS=Dispatching packets...\n" ++ "MAINPID=%lu", ++ (unsigned long) getpid()); ++#endif ++ + /* Start dispatching packets and timeouts... */ + dispatch(); + +diff -up dhcp-4.2.5/server/dhcpd.c.sd-daemon dhcp-4.2.5/server/dhcpd.c +--- dhcp-4.2.5/server/dhcpd.c.sd-daemon 2014-07-07 12:13:21.419323370 +0200 ++++ dhcp-4.2.5/server/dhcpd.c 2014-07-07 12:16:57.838319165 +0200 +@@ -60,6 +60,10 @@ static const char url [] = + + #include "trace.h" + ++#ifdef HAVE_LIBSYSTEMD_DAEMON ++#include ++#endif ++ + #ifndef UNIT_TEST + static void usage(void); + #endif +@@ -869,6 +873,15 @@ main(int argc, char **argv) { + (omapi_object_t *)0, "state", server_running); + + TRACE(DHCPD_MAIN()); ++ ++#ifdef HAVE_LIBSYSTEMD_DAEMON ++ /* We are ready to process incomming packets. Let's notify systemd */ ++ sd_notifyf(0, "READY=1\n" ++ "STATUS=Dispatching packets...\n" ++ "MAINPID=%lu", ++ (unsigned long) getpid()); ++#endif ++ + /* Receive packets and dispatch them... */ + dispatch (); + diff --git a/SOURCES/dhcpd.service b/SOURCES/dhcpd.service index 13269b7..746011b 100644 --- a/SOURCES/dhcpd.service +++ b/SOURCES/dhcpd.service @@ -5,6 +5,7 @@ After=network.target After=time-sync.target [Service] +Type=notify ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid [Install] diff --git a/SOURCES/dhcpd6.service b/SOURCES/dhcpd6.service index 212032c..32d3eda 100644 --- a/SOURCES/dhcpd6.service +++ b/SOURCES/dhcpd6.service @@ -5,6 +5,7 @@ After=network.target After=time-sync.target [Service] +Type=notify ExecStart=/usr/sbin/dhcpd -f -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid [Install] diff --git a/SOURCES/dhcrelay.service b/SOURCES/dhcrelay.service index 178d5b4..b84c4ff 100644 --- a/SOURCES/dhcrelay.service +++ b/SOURCES/dhcrelay.service @@ -4,6 +4,7 @@ Documentation=man:dhcrelay(8) After=network.target [Service] +Type=notify ExecStart=/usr/sbin/dhcrelay -d --no-pid [Install] diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec index 50beb0c..371ea08 100644 --- a/SPECS/dhcp.spec +++ b/SPECS/dhcp.spec @@ -18,7 +18,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.2.5 -Release: 27%{?dist} +Release: 27%{?dist}.1 # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -81,8 +81,7 @@ Patch47: dhcp-4.2.5-range6.patch Patch48: dhcp-4.2.5-next-server.patch Patch49: dhcp-4.2.5-ipv6-bind-to-interface.patch Patch50: dhcp-ffff-checksum.patch - -Patch1000: dhcp-4.2.5-centos-branding.patch +Patch51: dhcp-sd-daemon.patch BuildRequires: autoconf BuildRequires: automake @@ -90,7 +89,7 @@ BuildRequires: libtool BuildRequires: openldap-devel BuildRequires: libcap-ng-devel BuildRequires: bind-lite-devel -BuildRequires: systemd +BuildRequires: systemd systemd-devel %if 0%{?fedora} # %%check # there's no atf package in RHEL @@ -354,7 +353,8 @@ rm -rf includes/isc-dhcp # (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #25587]) %patch50 -p1 -b .ffff -%patch1000 -p1 -b .centos +# support for sending startup notification to systemd (#1087245) +%patch51 -p1 -b .sd-daemon # Update paths in all man pages for page in client/dhclient.conf.5 client/dhclient.leases.5 \ @@ -398,7 +398,8 @@ CFLAGS="%{optflags} -fno-strict-aliasing" \ %if 0%{?fedora} --with-atf \ %endif - --enable-paranoia --enable-early-chroot + --enable-paranoia --enable-early-chroot \ + --with-systemd %{__make} %{?_smp_mflags} %if 0%{?fedora} @@ -515,10 +516,15 @@ exit 0 # Initial installation %systemd_post dhcpd.service dhcpd6.service dhcrelay.service -# Update -if [ $1 -gt 1 ] ; then - chown -R dhcpd:dhcpd %{_localstatedir}/lib/dhcpd/ -fi +chown -R dhcpd:dhcpd %{_localstatedir}/lib/dhcpd/ + +for servicename in dhcpd dhcpd6 dhcrelay; do + etcservicefile=%{_sysconfdir}/systemd/system/${servicename}.service + if [ -f ${etcservicefile} ]; then + grep -q Type= ${etcservicefile} || sed -i '/\[Service\]/a Type=notify' ${etcservicefile} + fi +done +exit 0 %preun @@ -623,8 +629,8 @@ done %changelog -* Wed Jun 18 2014 Johnny Hughes - 12:4.2.5-27.el7.centos -- Roll in CentOS Branding +* Mon Jul 07 2014 Jiri Popelka - 12:4.2.5-27.1 +- support for sending startup notification to systemd (#1087245) * Fri Jan 24 2014 Daniel Mach - 12:4.2.5-27 - Mass rebuild 2014-01-24