Move terminal startup from enit main.go to esvm service files
This commit is contained in:
parent
b04fd51245
commit
5f9f7ab825
4
Makefile
4
Makefile
@ -34,6 +34,10 @@ install: build/enit build/ectl
|
|||||||
cp build/enit $(DESTDIR)$(SBINDIR)/esvm
|
cp build/enit $(DESTDIR)$(SBINDIR)/esvm
|
||||||
cp build/ectl $(DESTDIR)$(SBINDIR)/ectl
|
cp build/ectl $(DESTDIR)$(SBINDIR)/ectl
|
||||||
|
|
||||||
|
install-services:
|
||||||
|
mkdir -p $(DESTDIR)$(SYSCONFDIR)/esvm/services
|
||||||
|
cp services/* -t $(DESTDIR)$(SYSCONFDIR)/esvm/services
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -r build/
|
rm -r build/
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -48,7 +47,6 @@ func main() {
|
|||||||
waitZombieProcesses()
|
waitZombieProcesses()
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
startTerminal()
|
|
||||||
|
|
||||||
// Catch signals
|
// Catch signals
|
||||||
catchSignals()
|
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() {
|
func catchSignals() {
|
||||||
sigc := make(chan os.Signal, 1)
|
sigc := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigc, syscall.SIGUSR1, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD)
|
signal.Notify(sigc, syscall.SIGUSR1, syscall.SIGTERM, syscall.SIGINT, syscall.SIGCHLD)
|
||||||
|
5
services/agetty-tty1.esv
Normal file
5
services/agetty-tty1.esv
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: agetty-tty1
|
||||||
|
description: Start virtual terminal on tty1
|
||||||
|
type: background
|
||||||
|
start_cmd: /sbin/agetty --noclear tty1
|
||||||
|
exit_method: kill
|
5
services/agetty-tty2.esv
Normal file
5
services/agetty-tty2.esv
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: agetty-tty2
|
||||||
|
description: Start virtual terminal on tty2
|
||||||
|
type: background
|
||||||
|
start_cmd: /sbin/agetty --noclear tty2
|
||||||
|
exit_method: kill
|
5
services/agetty-tty3.esv
Normal file
5
services/agetty-tty3.esv
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: agetty-tty3
|
||||||
|
description: Start virtual terminal on tty3
|
||||||
|
type: background
|
||||||
|
start_cmd: /sbin/agetty --noclear tty3
|
||||||
|
exit_method: kill
|
5
services/agetty-tty4.esv
Normal file
5
services/agetty-tty4.esv
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: agetty-tty4
|
||||||
|
description: Start virtual terminal on tty4
|
||||||
|
type: background
|
||||||
|
start_cmd: /sbin/agetty --noclear tty4
|
||||||
|
exit_method: kill
|
5
services/agetty-tty5.esv
Normal file
5
services/agetty-tty5.esv
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: agetty-tty5
|
||||||
|
description: Start virtual terminal on tty5
|
||||||
|
type: background
|
||||||
|
start_cmd: /sbin/agetty --noclear tty5
|
||||||
|
exit_method: kill
|
5
services/agetty-tty6.esv
Normal file
5
services/agetty-tty6.esv
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name: agetty-tty6
|
||||||
|
description: Start virtual terminal on tty6
|
||||||
|
type: background
|
||||||
|
start_cmd: /sbin/agetty --noclear tty6
|
||||||
|
exit_method: kill
|
Loading…
x
Reference in New Issue
Block a user