!37 Add fallback to hostname determination
From: @hugel Reviewed-by: @shenyangyang01 Signed-off-by: @shenyangyang01
This commit is contained in:
commit
f2fced005e
32
Add-fallback-to-hostname-determination.patch
Normal file
32
Add-fallback-to-hostname-determination.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From ddd74b5d971a734c7e88cda3764f7e059f163b51 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Zhukov <pzhukov@redhat.com>
|
||||
Date: Jul 14 2021 10:26:33 +0000
|
||||
Subject: Add fallback to hostname determination
|
||||
|
||||
Use hostname in case if hostnamectl is not available/not functional.
|
||||
fallback to uname in case if both hostname and hostnamectl are
|
||||
missed (in containers)
|
||||
|
||||
Reference:https://pagure.io/setup/c/ddd74b5d971a734c7e88cda3764f7e059f163b51
|
||||
Conflict:Adjusting the command execution sequence and add a prompt.
|
||||
|
||||
---
|
||||
|
||||
diff --git a/profile b/profile
|
||||
index 783fe17..542add4 100644
|
||||
--- a/profile
|
||||
+++ b/profile
|
||||
@@ -42,7 +42,10 @@ else
|
||||
pathmunge /usr/sbin after
|
||||
fi
|
||||
|
||||
-HOSTNAME=`/usr/bin/hostnamectl --transient 2>/dev/null`
|
||||
+HOSTNAME=$(/usr/bin/hostname 2>/dev/null) || \
|
||||
+HOSTNAME=$(/usr/bin/uname -n 2>/dev/null) || \
|
||||
+HOSTNAME=$(/usr/bin/hostnamectl --transient 2>/dev/null) || echo "System commands: hostname uname and hostnamectl, which do not exist."
|
||||
+
|
||||
HISTSIZE=1000
|
||||
if [ "$HISTCONTROL" = "ignorespace" ] ; then
|
||||
export HISTCONTROL=ignoreboth
|
||||
--
|
||||
2.27.0
|
||||
@ -1,13 +1,14 @@
|
||||
Summary: A set of system configuration and setup files
|
||||
Name: setup
|
||||
Version: 2.13.7
|
||||
Release: 3
|
||||
Release: 4
|
||||
License: Public Domain
|
||||
Group: System Environment/Base
|
||||
URL: https://pagure.io/setup/
|
||||
Source0: http://releases.pagure.org/%{name}/%{name}-%{version}.tar.bz2
|
||||
Patch0: support-filesystems-xfs.patch
|
||||
Patch1: source-cshlocal-when-login.patch
|
||||
Patch2: Add-fallback-to-hostname-determination.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: systemd
|
||||
BuildRequires: bash tcsh perl-interpreter
|
||||
@ -117,6 +118,9 @@ end
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
%changelog
|
||||
* Thu Feb 6 2025 hugel <gengqihu2@h-partners.com> - 2.13.7-4
|
||||
- Add fallback to hostname determination
|
||||
|
||||
* Fri May 6 2022 konglidong <konglidong@uniontech.com> - 2.13.7-3
|
||||
- modify bogus date in %changelog
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user