kopia lustrzana https://github.com/cyoung/stratux
rodzic
39bb2e3415
commit
8f4a52d739
|
@ -1446,7 +1446,7 @@ func openReplayFile(fn string) ReadCloser {
|
|||
var stratuxClock *monotonic
|
||||
var sigs = make(chan os.Signal, 1) // Signal catch channel (shutdown).
|
||||
|
||||
// Graceful shutdown.
|
||||
// Graceful shutdown. Do everything except for kill the process.
|
||||
func gracefulShutdown() {
|
||||
// Shut down SDRs.
|
||||
sdrKill()
|
||||
|
@ -1463,7 +1463,6 @@ func gracefulShutdown() {
|
|||
|
||||
// Turn off green ACT LED on the Pi.
|
||||
ioutil.WriteFile("/sys/class/leds/led0/brightness", []byte("0\n"), 0644)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Close log file handle, open new one.
|
||||
|
@ -1489,6 +1488,7 @@ func signalWatcher() {
|
|||
} else {
|
||||
log.Printf("signal caught: %s - shutting down.\n", sig.String())
|
||||
gracefulShutdown()
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -414,14 +414,14 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func handleShutdownRequest(w http.ResponseWriter, r *http.Request) {
|
||||
syscall.Sync()
|
||||
syscall.Reboot(syscall.LINUX_REBOOT_CMD_POWER_OFF)
|
||||
gracefulShutdown()
|
||||
syscall.Reboot(syscall.LINUX_REBOOT_CMD_POWER_OFF)
|
||||
}
|
||||
|
||||
func doReboot() {
|
||||
syscall.Sync()
|
||||
syscall.Reboot(syscall.LINUX_REBOOT_CMD_RESTART)
|
||||
gracefulShutdown()
|
||||
syscall.Reboot(syscall.LINUX_REBOOT_CMD_RESTART)
|
||||
}
|
||||
|
||||
func handleDeleteLogFile(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Ładowanie…
Reference in New Issue