mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-07-10 05:34:10 +00:00
Seems like provider can build for windows for the kairosctl command and it would fail due to the systemd libs not being available to build under windows so we need to protect against that Signed-off-by: Itxaka <itxaka@kairos.io>
24 lines
343 B
Go
24 lines
343 B
Go
//go:build !windows
|
|
|
|
package types
|
|
|
|
import (
|
|
"io"
|
|
"net"
|
|
|
|
"github.com/rs/zerolog/journald"
|
|
)
|
|
|
|
func isJournaldAvailable() bool {
|
|
conn, err := net.Dial("unixgram", "/run/systemd/journal/socket")
|
|
if err != nil {
|
|
return false
|
|
}
|
|
defer conn.Close()
|
|
return true
|
|
}
|
|
|
|
func getJournaldWriter() io.Writer {
|
|
return journald.NewJournalDWriter()
|
|
}
|