mirror of
https://github.com/EnumeratedDev/enit.git
synced 2026-09-16 02:26:11 +00:00
Move terminal startup from enit main.go to esvm service files
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user