go-sysinfo icon indicating copy to clipboard operation
go-sysinfo copied to clipboard

FreeBSD support

Open dbolcsfoldi opened this issue 6 years ago • 4 comments
trafficstars

Add FreeBSD provider. When I was attempting to use this package on FreeBSD I noticed the provider was completely missing, so I implemented a provider for FreeBSD.

Note that for the system_test.go that test's the current working directory I modified the test code to compare the inodes using os.SameFile instead of straight file comparison. The reason is that os.Getcwd() will return any path to CWD (either symlink or real path) but for any process except the calling pid (i.e. calling C.getcwd()) will return the real path and not the symlink.

I've tested it on FreeBSD 11.2 and 12.0 using 'go test', let me know if you need anything else to be run and please feel free to leave any review comments/reject the pull request etc.

dbolcsfoldi avatar Feb 12 '19 04:02 dbolcsfoldi

I've encounter the the problem on FreeBSD - unimplemented github.com/elastic/go-sysinfo/types.init /usr/local/me/go/pkg/mod/github.com/elastic/[email protected]/types/errors.go:23

lin7sh avatar Jan 22 '21 09:01 lin7sh

@mko-io This pull request is very old, I haven't updated it in a while. If you still need FreeBSD support for sysinfo I'd be happy to review it.

dbolcsfoldi avatar Jan 25 '21 16:01 dbolcsfoldi

@dbolcsfoldi would be nice, as this would make metricbeats on freebsd usable

dasTor avatar Apr 19 '21 11:04 dasTor

@dbolcsfoldi - I'm interested in having freebsd support included in this module. I might even be able to spare some cycles if help is needed, though I have limited Go experience.

I'm not sure if anybody on this thread is an Elastic employee, but input would be helpful!

smkriebel avatar Jun 24 '21 14:06 smkriebel

Closing this as we have #126 which incorporates this with some updates.

Thanks @dbolcsfoldi .

andrewkroh avatar Mar 14 '24 16:03 andrewkroh