Skip to content

try using fully qualified domain name, hostname -f, to match METAQ_MA…#19

Open
walkloud wants to merge 1 commit into
evanberkowitz:masterfrom
walkloud:feature/hostname-fqdn
Open

try using fully qualified domain name, hostname -f, to match METAQ_MA…#19
walkloud wants to merge 1 commit into
evanberkowitz:masterfrom
walkloud:feature/hostname-fqdn

Conversation

@walkloud
Copy link
Copy Markdown
Collaborator

@walkloud walkloud commented Apr 3, 2024

…CHINE

hostname -f returns the fully qualified domain name, rather than the names like login15. Using the FQDN and modifying the match condition from

if [[ ! "`hostname -f`" =~ $MACHINE_MATCH ]]; then

to

[[ ! "`hostname -f`" == *$METAQ_MACHINE* ]]; then

allows for example

x/abandon perlmutter

to work without raising the warning about HOSTNAME not matching METAQ_MACHINE. I'm not sure I've thought through all potential pitfalls with the modified string matching, but I think it is safe.

@evanberkowitz
Copy link
Copy Markdown
Owner

The main thing I don't know for sure is: is hostname -f portable across linux, unix, darwin?

@evanberkowitz
Copy link
Copy Markdown
Owner

evanberkowitz commented Apr 14, 2024

Jureca:

> cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.9 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.9 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.9"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.9"

> uname --all
Linux jrlogin09.jureca 4.18.0-513.18.1.el8_9.x86_64 #1 SMP Wed Feb 21 21:34:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

> hostname -f
jrlogin09.jureca

@evanberkowitz
Copy link
Copy Markdown
Owner

Mac OS:

> uname --all
Darwin Mandos 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:51:37 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T8112 arm64 arm Darwin

> hostname -f
Mandos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants