diff --git a/Makefile b/Makefile index 633c2dd..a2af145 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,10 @@ install: build/enit build/ectl cp build/enit $(DESTDIR)$(SBINDIR)/esvm cp build/ectl $(DESTDIR)$(SBINDIR)/ectl +install-services: + mkdir -p $(DESTDIR)$(SYSCONFDIR)/esvm/services + cp services/* -t $(DESTDIR)$(SYSCONFDIR)/esvm/services + clean: rm -r build/ diff --git a/cmd/enit/main.go b/cmd/enit/main.go index fb1fc55..521ee21 100644 --- a/cmd/enit/main.go +++ b/cmd/enit/main.go @@ -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) diff --git a/services/agetty-tty1.esv b/services/agetty-tty1.esv new file mode 100644 index 0000000..fbb043e --- /dev/null +++ b/services/agetty-tty1.esv @@ -0,0 +1,5 @@ +name: agetty-tty1 +description: Start virtual terminal on tty1 +type: background +start_cmd: /sbin/agetty --noclear tty1 +exit_method: kill \ No newline at end of file diff --git a/services/agetty-tty2.esv b/services/agetty-tty2.esv new file mode 100644 index 0000000..3dca966 --- /dev/null +++ b/services/agetty-tty2.esv @@ -0,0 +1,5 @@ +name: agetty-tty2 +description: Start virtual terminal on tty2 +type: background +start_cmd: /sbin/agetty --noclear tty2 +exit_method: kill \ No newline at end of file diff --git a/services/agetty-tty3.esv b/services/agetty-tty3.esv new file mode 100644 index 0000000..53695d8 --- /dev/null +++ b/services/agetty-tty3.esv @@ -0,0 +1,5 @@ +name: agetty-tty3 +description: Start virtual terminal on tty3 +type: background +start_cmd: /sbin/agetty --noclear tty3 +exit_method: kill \ No newline at end of file diff --git a/services/agetty-tty4.esv b/services/agetty-tty4.esv new file mode 100644 index 0000000..44c2050 --- /dev/null +++ b/services/agetty-tty4.esv @@ -0,0 +1,5 @@ +name: agetty-tty4 +description: Start virtual terminal on tty4 +type: background +start_cmd: /sbin/agetty --noclear tty4 +exit_method: kill \ No newline at end of file diff --git a/services/agetty-tty5.esv b/services/agetty-tty5.esv new file mode 100644 index 0000000..e0ef7ab --- /dev/null +++ b/services/agetty-tty5.esv @@ -0,0 +1,5 @@ +name: agetty-tty5 +description: Start virtual terminal on tty5 +type: background +start_cmd: /sbin/agetty --noclear tty5 +exit_method: kill \ No newline at end of file diff --git a/services/agetty-tty6.esv b/services/agetty-tty6.esv new file mode 100644 index 0000000..3c75ab7 --- /dev/null +++ b/services/agetty-tty6.esv @@ -0,0 +1,5 @@ +name: agetty-tty6 +description: Start virtual terminal on tty6 +type: background +start_cmd: /sbin/agetty --noclear tty6 +exit_method: kill \ No newline at end of file