Move terminal startup from enit main.go to esvm service files

This commit is contained in:
2025-02-23 18:47:37 +02:00
parent b04fd51245
commit 5f9f7ab825
8 changed files with 34 additions and 17 deletions
-17
View File
@@ -8,7 +8,6 @@ import (
"os/exec"
"os/signal"
"path"
"strconv"
"syscall"
"time"
)
@@ -48,7 +47,6 @@ func main() {
waitZombieProcesses()
fmt.Println()
startTerminal()
// Catch signals
catchSignals()
@@ -136,21 +134,6 @@ func waitZombieProcesses() {
}
}
func startTerminal() {
for i := 1; i < 6; i++ {
cmd := exec.Command("/sbin/agetty", "--noclear", "tty"+strconv.Itoa(i))
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Start()
if err != nil {
log.Println("Could not start agetty terminal on tty" + strconv.Itoa(i) + "!")
panic(err)
}
}
}
func catchSignals() {
sigc := make(chan os.Signal, 1)
signal.Notify(sigc, syscall.SIGUSR1, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD)