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

No /proc/sys/kernel/hostname file #562

Closed
sepiroth887 opened this issue Jun 21, 2016 · 9 comments
Closed

No /proc/sys/kernel/hostname file #562

sepiroth887 opened this issue Jun 21, 2016 · 9 comments
Labels

Comments

@sepiroth887
Copy link

im using Hub (https://github.com/github/hub) quite a lot but it seems that it's trying to lookup it's local hostname via /proc/sys/kernel/hostname.

Is that something that can be supported in the future?

@sepiroth887
Copy link
Author

The failure seems to come from GoLang's os.Hostname() call, so not just this tool being affected I'd assume.

@benhillis
Copy link
Member

Sure thing, I'll file a bug to get this added. It looks like we're missing a lot of files in /proc/sys/kernel.

As a workaround, we do have the hostname in /etc/hostname.

@sepiroth887
Copy link
Author

👍
I found that too. May do a temp fix on.my.own hub branch but doubt fixing go os package is an option. :)

Get Outlook for mobile

On Tue, Jun 21, 2016 at 9:26 AM -0700, "Ben Hillis" [email protected] wrote:

Sure thing, I'll file a bug to get this added. It looks like we're missing a lot of files in /proc/sys/kernel.

As a workaround, we do have the hostname in /etc/hostname.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@sundhaug92
Copy link

Shouldn't it rather use /etc/hostname ?

On Tue, Jun 21, 2016 at 6:47 PM, Tobias Haag [email protected]
wrote:

👍
I found that too. May do a temp fix on.my.own hub branch but doubt fixing
go os package is an option. :)

Get Outlook for mobile

On Tue, Jun 21, 2016 at 9:26 AM -0700, "Ben Hillis" <
[email protected]> wrote:

Sure thing, I'll file a bug to get this added. It looks like we're missing
a lot of files in /proc/sys/kernel.

As a workaround, we do have the hostname in /etc/hostname.


You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#562 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAfsc_llOkGBwr4w1WepCSVpjV2pBrd6ks5qOBWagaJpZM4I665a
.

@benhillis
Copy link
Member

@sundhaug92 - You'll have to ask Google :)

I'm sure there's some reason this was chosen. Perhaps /etc/hostname is written by some daemon that not all distros run.

@sepiroth887
Copy link
Author

Looks like proc location is the default for rhel/centos whereas Ubuntu seems to favor /etc

Get Outlook for mobile

On Tue, Jun 21, 2016 at 9:53 AM -0700, "Ben Hillis" [email protected] wrote:

@sundhaug92 - You'll have to ask Google :)

I'm sure there's some reason this was chosen. Perhaps /etc/hostname is written by some daemon that not all distros run.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@DHowett
Copy link
Member

DHowett commented Jun 23, 2016

More to the point, /proc/sys/kernel/hostname is the real and effective hostname of the system, and /etc/hostname is a configuration file that is used to set that hostname. Since one is a specified kernel interface (/proc/...) and the other is a distribution-specific configuration file, it makes sense that Go would choose /proc/....

That said, though, there's a syscall gethostname(2), which really is the right tool for the job. It's curious that Go doesn't use it.

@benhillis
Copy link
Member

@DHowett That's a good explaination. You can also get the host name via the uname system call. I'm also curious why Go doesn't use one of the syscalls.

@benhillis
Copy link
Member

This file has been implemented. Not sure if it made Anniversary Update but it's definitely in new Insider builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants