dhclient-script: hostname -> hostnamectl --transient
For selinux-policy see https://bugzilla.redhat.com/show_bug.cgi?id=1242583
This commit is contained in:
parent
3a458259f5
commit
d6db3a5145
@ -48,7 +48,7 @@ logmessage() {
|
|||||||
|
|
||||||
eventually_add_hostnames_domain_to_search() {
|
eventually_add_hostnames_domain_to_search() {
|
||||||
# For the case when hostname for this machine has a domain that is not in domain_search list
|
# For the case when hostname for this machine has a domain that is not in domain_search list
|
||||||
# 1) get a hostname with `ipcalc --hostname` or `hostname`
|
# 1) get a hostname with `ipcalc --hostname` or `hostnamectl --transient`
|
||||||
# 2) get the domain from this hostname
|
# 2) get the domain from this hostname
|
||||||
# 3) add this domain to search line in resolv.conf if it's not already
|
# 3) add this domain to search line in resolv.conf if it's not already
|
||||||
# there (domain list that we have recently added there is a parameter of this function)
|
# there (domain list that we have recently added there is a parameter of this function)
|
||||||
@ -68,7 +68,7 @@ eventually_add_hostnames_domain_to_search() {
|
|||||||
domain=$(echo "${HOSTNAME}" | cut -s -d "." -f 2-)
|
domain=$(echo "${HOSTNAME}" | cut -s -d "." -f 2-)
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
domain=$(hostname 2>/dev/null | cut -s -d "." -f 2-)
|
domain=$(hostnamectl --transient 2>/dev/null | cut -s -d "." -f 2-)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${domain}" ] &&
|
if [ -n "${domain}" ] &&
|
||||||
@ -550,7 +550,7 @@ dhconfig() {
|
|||||||
make_resolv_conf
|
make_resolv_conf
|
||||||
|
|
||||||
if [ -n "${new_host_name}" ] && need_hostname; then
|
if [ -n "${new_host_name}" ] && need_hostname; then
|
||||||
hostname "${new_host_name}" || echo "See -nc option in dhclient(8) man page."
|
hostnamectl set-hostname --transient --no-ask-password "${new_host_name}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ( "${DHCP_TIME_OFFSET_SETS_TIMEZONE}" = [yY1]* ) &&
|
if [[ ( "${DHCP_TIME_OFFSET_SETS_TIMEZONE}" = [yY1]* ) &&
|
||||||
@ -680,7 +680,7 @@ dh6config() {
|
|||||||
|
|
||||||
need_hostname ()
|
need_hostname ()
|
||||||
{
|
{
|
||||||
CHECK_HOSTNAME=$(hostname)
|
CHECK_HOSTNAME=$(hostnamectl --transient)
|
||||||
if [[ "${CHECK_HOSTNAME}" = "(none)" ]] ||
|
if [[ "${CHECK_HOSTNAME}" = "(none)" ]] ||
|
||||||
[[ "${CHECK_HOSTNAME}" = "localhost" ]] ||
|
[[ "${CHECK_HOSTNAME}" = "localhost" ]] ||
|
||||||
[[ "${CHECK_HOSTNAME}" = "localhost.localdomain" ]]; then
|
[[ "${CHECK_HOSTNAME}" = "localhost.localdomain" ]]; then
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
Summary: Dynamic host configuration protocol software
|
Summary: Dynamic host configuration protocol software
|
||||||
Name: dhcp
|
Name: dhcp
|
||||||
Version: 4.3.3
|
Version: 4.3.3
|
||||||
Release: 6%{?dist}
|
Release: 7%{?dist}
|
||||||
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
|
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
|
||||||
# dcantrell maintaining the package) made incorrect use of the epoch and
|
# 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.
|
# that's why it is at 12 now. It should have never been used, but it was.
|
||||||
@ -157,7 +157,7 @@ Summary: Provides the ISC DHCP client daemon and dhclient-script
|
|||||||
Provides: dhclient = %{epoch}:%{version}-%{release}
|
Provides: dhclient = %{epoch}:%{version}-%{release}
|
||||||
Obsoletes: dhclient < %{epoch}:%{version}-%{release}
|
Obsoletes: dhclient < %{epoch}:%{version}-%{release}
|
||||||
# dhclient-script requires:
|
# dhclient-script requires:
|
||||||
Requires: coreutils grep sed gawk hostname iproute iputils /usr/bin/ipcalc
|
Requires: coreutils gawk grep ipcalc iproute iputils sed systemd
|
||||||
Requires: %{name}-common = %{epoch}:%{version}-%{release}
|
Requires: %{name}-common = %{epoch}:%{version}-%{release}
|
||||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
|
|
||||||
@ -663,6 +663,9 @@ done
|
|||||||
%doc doc/html/
|
%doc doc/html/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 23 2015 Jiri Popelka <jpopelka@redhat.com> - 12:4.3.3-7
|
||||||
|
- dhclient-script: hostname -> hostnamectl --transient
|
||||||
|
|
||||||
* Tue Nov 03 2015 Jiri Popelka <jpopelka@redhat.com> - 12:4.3.3-6
|
* Tue Nov 03 2015 Jiri Popelka <jpopelka@redhat.com> - 12:4.3.3-6
|
||||||
- dhclient-script: source ifcfg-* because of PEERDNS (#1277253)
|
- dhclient-script: source ifcfg-* because of PEERDNS (#1277253)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user