I have a systemd service file that runs a java program in another tty
[Unit]
Description=java program
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/java -cp "/home/user/someclass.jar"
Restart=always
RestartSec=10
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
TTYPath=/dev/tty10
TTYVTDisallocate=yes
TTYReset=yes
TTYVHangup=yes
[Install]
WantedBy=multi-user.target
The program waits for input in the tty, I can change to that tty by using Ctrl+Alt+F10 or using chvt 10
and I'm able to interact with the program.
Now I want to send input and get output from that tty without changing my current tty.
I tried using screen
and all I get is a blank screen and. I tried using script
which succeeded if I run bash in that tty but fails If i run a java program
socat
to run on /dev/tty10? Also looking at the man page ofdtach
I see no mention ofdtach
working with ttys, only sockets. – MOHAMMAD RASIM Mar 06 '18 at 12:19