From 3bf9a6bb98a6bc49387e04c90d3c63db53b5a659 Mon Sep 17 00:00:00 2001 From: Honza Horak Date: Fri, 5 Sep 2014 17:36:15 +0200 Subject: [PATCH] Require hostname for domainname in pre Do not crash in pre if /etc/sysconfig/network is missing --- ypserv.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ypserv.spec b/ypserv.spec index 950f983..115ece0 100644 --- a/ypserv.spec +++ b/ypserv.spec @@ -4,7 +4,7 @@ Summary: The NIS (Network Information Service) server Url: http://www.linux-nis.org/nis/ypserv/index.html Name: ypserv Version: 2.32.1 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2 Group: System Environment/Daemons Source0: http://www.linux-nis.org/download/ypserv/ypserv-%{version}.tar.bz2 @@ -16,6 +16,8 @@ Source5: yppasswdd-pre-setdomain Requires: gawk, make, portmap, bash >= 2.0 Requires: tokyocabinet +# requirement for domainname +Requires(pre): hostname Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -166,7 +168,7 @@ if [ $1 == 2 ] ; then fi # store old domainname and set the correct one olddomain=`domainname` - . /etc/sysconfig/network + [ -f /etc/sysconfig/network ] $$ . /etc/sysconfig/network DOMAINNAME=`domainname` if [ "$olddomain" = "(none)" -o "x$olddomain" = "x" ]; then if [ -n "$NISDOMAIN" ]; then @@ -224,6 +226,10 @@ fi %{_includedir}/rpcsvc %changelog +* Fri Sep 05 2014 Honza Horak - 2.32.1-5 +- Require hostname for domainname in pre + Do not crash in pre if /etc/sysconfig/network is missing + * Thu Aug 21 2014 Kevin Fenzi - 2.32.1-4 - Rebuild for rpm bug 1131960