Respect NISDOMAIN environment variable and set domainname if empty
Resolves: #699826
This commit is contained in:
parent
58f3fb9f87
commit
3a5608e845
21
ypserv-pre-setdomain
Normal file
21
ypserv-pre-setdomain
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ypserv-domain
|
||||
#
|
||||
# description: This is part of former ypserv init script, which is used
|
||||
# to setup proper domainname before starting ypserv daemon
|
||||
# itself. If $NISDOMAIN is not defined, it fails.
|
||||
#
|
||||
|
||||
DOMAINNAME=`domainname`
|
||||
if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then
|
||||
echo -n $"Setting NIS domain: "
|
||||
if [ -n "$NISDOMAIN" ]; then
|
||||
domainname $NISDOMAIN
|
||||
echo $"'$NISDOMAIN' (environment variable)"
|
||||
else # no domainname found
|
||||
logger -t ypserv $"domain not found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
@ -5,6 +5,7 @@ After=syslog.target network.target rpcbind.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/sysconfig/network
|
||||
ExecStartPre=/usr/lib/ypserv/ypserv-pre-setdomain
|
||||
ExecStart=/usr/sbin/ypserv -f $YPSERV_ARGS
|
||||
|
||||
[Install]
|
||||
|
24
ypserv.spec
24
ypserv.spec
@ -2,7 +2,7 @@ Summary: The NIS (Network Information Service) server
|
||||
Url: http://www.linux-nis.org/nis/ypserv/index.html
|
||||
Name: ypserv
|
||||
Version: 2.26
|
||||
Release: 9%{?dist}
|
||||
Release: 10%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Daemons
|
||||
Source0: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypserv-%{version}.tar.bz2
|
||||
@ -10,6 +10,7 @@ Source1: ypserv.service
|
||||
Source2: yppasswdd.service
|
||||
Source3: ypxfrd.service
|
||||
Source4: rpc.yppasswdd.env
|
||||
Source5: ypserv-pre-setdomain
|
||||
|
||||
Requires: gawk, make, portmap, bash >= 2.0
|
||||
Requires(post): systemd-units
|
||||
@ -36,6 +37,9 @@ Patch15: ypserv-2.26-retval.patch
|
||||
BuildRequires: compat-gdbm-devel
|
||||
BuildRequires: systemd-units
|
||||
|
||||
# Location where helper scripts are located
|
||||
%define scripts_path /usr/lib/%{name}
|
||||
|
||||
%description
|
||||
The Network Information Service (NIS) is a system that provides
|
||||
network information (login names, passwords, home directories, group
|
||||
@ -86,11 +90,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
#make install ROOT=$RPM_BUILD_ROOT
|
||||
%makeinstall libexecdir=$RPM_BUILD_ROOT%{_libdir}/yp INSTALL_PROGRAM=install
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir} $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -m644 etc/ypserv.conf $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/ypserv.service
|
||||
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/yppasswdd.service
|
||||
install -m644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/ypxfrd.service
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir} $RPM_BUILD_ROOT%{_sysconfdir} $RPM_BUILD_ROOT%{scripts_path}
|
||||
install -m 644 etc/ypserv.conf $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/ypserv.service
|
||||
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/yppasswdd.service
|
||||
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/ypxfrd.service
|
||||
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{scripts_path}/ypserv-pre-setdomain
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
|
||||
cat >$RPM_BUILD_ROOT/etc/sysconfig/yppasswdd <<EOF
|
||||
@ -120,7 +125,7 @@ EOF
|
||||
# (ETCDIR, PASSWDFILE and SHADOWFILE). The script ensures, that the
|
||||
# rpc.yppasswdd arguments are not used when the appropriate environment
|
||||
# variables are empty.
|
||||
install -m755 %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/rpc.yppasswdd.env
|
||||
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/rpc.yppasswdd.env
|
||||
|
||||
%post
|
||||
# Package with native systemd unit file is installed for the first time
|
||||
@ -164,12 +169,17 @@ exit 0
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/yppasswdd
|
||||
%config(noreplace) /var/yp/*
|
||||
%{_unitdir}/*
|
||||
%{scripts_path}/*
|
||||
%{_libdir}/yp
|
||||
%{_sbindir}/*
|
||||
%{_mandir}/*/*
|
||||
%{_includedir}/*/*
|
||||
|
||||
%changelog
|
||||
* Thu Jan 12 2012 Honza Horak <hhorak@redhat.com> - 2.26-10
|
||||
- Respect NISDOMAIN environment variable and set domainname if empty
|
||||
Resolves: #699826
|
||||
|
||||
* Mon Dec 12 2011 Honza Horak <hhorak@redhat.com> - 2.26-9
|
||||
- Rebuild against compat_gdbm, because gdbm has changed license
|
||||
to GPLv3+ and it is not compatible with ypserv GPLv2
|
||||
|
Loading…
Reference in New Issue
Block a user