Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More portable extraction of short hostname #13109

Merged
merged 1 commit into from Aug 25, 2015
Merged

More portable extraction of short hostname #13109

merged 1 commit into from Aug 25, 2015

Conversation

jasontedor
Copy link
Member

This commit increases the portability of extracting the short hostname
on a Unix-like system.

Closes #13107

@jasontedor jasontedor added >bug review :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v2.1.0 labels Aug 25, 2015
@nik9000
Copy link
Member

nik9000 commented Aug 25, 2015

This probably deserves a comment or some helpful person will revert it back to hostname -s. Which unices don't have -s, btw?

@nik9000
Copy link
Member

nik9000 commented Aug 25, 2015

This probably deserves a comment or some helpful person will revert it back to hostname -s. Which unices don't have -s, btw?

This probably deserves a comment or some helpful person will revert it back to hostname -s. Which unices don't have -s, btw?

Ah. Solaris 10.

@nik9000
Copy link
Member

nik9000 commented Aug 25, 2015

Otherwise LGTM.

This commit increases the portability of extracting the short hostname
on a Unix-like system.

Closes #13107
@jasontedor
Copy link
Member Author

@nik9000 Also HP-UX.

I've added a comment as you requested. I also discovered in the course of testing this is on Solaris VM that combining the variable definition and export into a single line isn't supported in some shells (namely the Bourne shell which is the default shell on Solaris). I've found a more portable way to do the export as well. I've updated the pull request accordingly.

@nik9000
Copy link
Member

nik9000 commented Aug 25, 2015

I've found a more portable way to do the export as well. I've updated the pull request accordingly.

Bleh. I'm not against just using #!/bin/bash instead of #!/bin/sh.

Thanks for adding the comment - that is perfect.

@jasontedor
Copy link
Member Author

I'm not against just using #!/bin/bash instead of #!/bin/sh.

@nik9000 I've been contemplating that as well but at a minimum it is a separate issue from this one.

jasontedor added a commit that referenced this pull request Aug 25, 2015
More portable extraction of short hostname
@jasontedor jasontedor merged commit 9ceca39 into elastic:master Aug 25, 2015
@jasontedor jasontedor removed the review label Aug 25, 2015
@jasontedor jasontedor deleted the fix/13107 branch August 25, 2015 18:51
jasontedor added a commit that referenced this pull request Aug 25, 2015
This commit backports the fix #13109 for #13107 to 2.0 from master.
@nik9000
Copy link
Member

nik9000 commented Aug 25, 2015

@nik9000 I've been contemplating that as well but at a minimum it is a separate issue from this one.

Yeah, probably.

@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team v2.0.0-beta2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"hostname -s" not available in at least Solaris 10
4 participants