golang-examples/shell/linux.go

28 lines
474 B
Go

//go:build linux && go1.7
// +build linux,go1.7
// put stuff in here that you only want compiled under linux
package shell
import (
"log"
"os"
"os/signal"
"syscall"
"github.com/wercker/journalhook"
)
var sigChan chan os.Signal
func handleSignal(err interface{}, ret int) {
log.Println("handleSignal() only should be compiled on linux")
sigChan = make(chan os.Signal, 3)
signal.Notify(sigChan, syscall.SIGUSR1)
}
func UseJournalctl() {
journalhook.Enable()
}