2024-01-25 00:39:14 -06:00
|
|
|
//go:build linux && go1.7
|
2019-06-14 06:20:29 -05:00
|
|
|
// +build linux,go1.7
|
|
|
|
|
|
|
|
// put stuff in here that you only want compiled under linux
|
|
|
|
|
|
|
|
package shell
|
|
|
|
|
2024-01-25 00:39:14 -06:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"os/signal"
|
|
|
|
"syscall"
|
2019-06-14 06:20:29 -05:00
|
|
|
|
2024-01-25 00:39:14 -06:00
|
|
|
"github.com/wercker/journalhook"
|
|
|
|
)
|
2019-06-14 06:20:29 -05:00
|
|
|
|
2024-01-25 00:39:14 -06:00
|
|
|
var sigChan chan os.Signal
|
2019-06-14 06:20:29 -05:00
|
|
|
|
|
|
|
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()
|
|
|
|
}
|