-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add sysinfo journalctl action to Sansshell #279
Conversation
660d1bc
to
86e9d37
Compare
Hmm, is this the first C library we're using? What happens if you try to cross-compile across architectures or compile for linux from macos? |
Yes, I think it is the first time we are using C library. Crossing compile linux from macos through GOOS=linux will always show this error message: And in devVM(linux env), if we directly compile it, another error will come out: The reason is that Go compiler is unable to find the systemd/sd-journal.h file while trying to compile the github.com/coreos/go-systemd/v22/sdjournal package. This file is part of the systemd library, which provides an API for interacting with the systemd journal. The resolution is to install the development package for systemd utility library like systemd-devel or libsystemd-dev. But I don't have a chance to cross-compile across architecture, let me test it. |
This is a pretty big bump in difficulty in compiling sansshell. I'm not convinced the benefits of this are worth the cost. We're jumping from "all you need is a go compiler if you're not touching protos" to "you need to install a non-default c library". Is there no pure go api for this? |
I understand it increases the complexity in compiling sansshell when introducing C package. I import sdjournal for following reasons:
But let me think other workaround. |
Closing this in favor of #293 |
Description
Add journalctl action to Sansshell to read messages from journald
Note
Sansshell server will fetch the journal entries through package: github.com/coreos/go-systemd/v22 which will call systemd C API through cgo. So in order to successfully run build, pre-commit and golangci-lint. Below command need to be run to install systemd development package.
Usage
Example