attach to tty running a process
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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
gnu-screen java tty
add a comment |Â
up vote
0
down vote
favorite
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
gnu-screen java tty
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
gnu-screen java tty
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
gnu-screen java tty
asked Mar 6 at 11:18
MOHAMMAD RASIM
586
586
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
The PTY
feature of socat
may be your best bet for interfacing terminal-heavy apps programmatically w/o any extra functionality. See the examples in the man page.
Also, dtach
provides screen
-like (multi-way) reattachment semantics for easy access from a terminal emulator.
Can you provide an example ofsocat
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 6 at 12:19
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The PTY
feature of socat
may be your best bet for interfacing terminal-heavy apps programmatically w/o any extra functionality. See the examples in the man page.
Also, dtach
provides screen
-like (multi-way) reattachment semantics for easy access from a terminal emulator.
Can you provide an example ofsocat
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 6 at 12:19
add a comment |Â
up vote
0
down vote
The PTY
feature of socat
may be your best bet for interfacing terminal-heavy apps programmatically w/o any extra functionality. See the examples in the man page.
Also, dtach
provides screen
-like (multi-way) reattachment semantics for easy access from a terminal emulator.
Can you provide an example ofsocat
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 6 at 12:19
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The PTY
feature of socat
may be your best bet for interfacing terminal-heavy apps programmatically w/o any extra functionality. See the examples in the man page.
Also, dtach
provides screen
-like (multi-way) reattachment semantics for easy access from a terminal emulator.
The PTY
feature of socat
may be your best bet for interfacing terminal-heavy apps programmatically w/o any extra functionality. See the examples in the man page.
Also, dtach
provides screen
-like (multi-way) reattachment semantics for easy access from a terminal emulator.
answered Mar 6 at 11:30
L29Ah
451112
451112
Can you provide an example ofsocat
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 6 at 12:19
add a comment |Â
Can you provide an example ofsocat
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 6 at 12:19
Can you provide an example of
socat
to run on /dev/tty10? Also looking at the man page of dtach
I see no mention of dtach
working with ttys, only sockets.â MOHAMMAD RASIM
Mar 6 at 12:19
Can you provide an example of
socat
to run on /dev/tty10? Also looking at the man page of dtach
I see no mention of dtach
working with ttys, only sockets.â MOHAMMAD RASIM
Mar 6 at 12:19
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428474%2fattach-to-tty-running-a-process%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password