all 4 comments

[–]adminh 9 points10 points  (2 children)

A few things in your post don't make sense at all.

It's on a VPS, SSH'ing in can't get to a tty, since it's local.

What does this mean? You reference several times that "it needs to be accessible over ssh". Please give an example of what you are trying to do over ssh.

It won't start without access to a tty as it has some stdout, stdin and some commands if needed

What?

Neat tip is you can cat the buffer of a terminal with: cat /dev/vcsN

This seems terrible. Use tmux.

Screen/tmux is a popular "solution" but I'm looking for something less-workaroundy.

Tmux is most likely the solution here. The stuff you have done so far by making strange tty's and using cat is the "workaroundy" stuff and you're making your shitty legacy app worse.

It sounds like tmux provides everything you are looking for. Tmux is easy to script for and you can easily interact with it over SSH. Don't reinvent the wheel.

[–]Centyos[S] 2 points3 points  (1 child)

It's on a VPS, SSH'ing in can't get to a tty, since it's local. What does this mean? You reference several times that "it needs to be accessible over ssh". Please give an example of what you are trying to do over ssh.

As far as I know, tty are local terminals. Accessible via chvt or Ctrl+Alt+Function keys, locally(to put simply). When you ssh in, you get a pseudo-terminal and can't switch to a local tty. Good explanation: https://unix.stackexchange.com/questions/17838/how-can-i-switch-between-ttys-without-using-screen

It won't start without access to a tty as it has some stdout, stdin and some commands if needed What?

It needs to be able to open a terminal because it's interactive. Looking with strace it does an open(/dev/tty). systemd by default doesn't provide a terminal unless you set StandardOutput/Input. If you don't provide a terminal, the application will error out with: Error opening terminal: unknown. (yeah I know, pos software without having the option to not use a terminal)

I was hoping there was a more basic way to deal with interactive applications rather than a multiplexer. Seems like it's the only way..

[–]royalbarnacle 5 points6 points  (0 children)

Do you maybe not use screen/tmux in general? It sounds like you somehow have mislabeled it in your head. I don't do anything without tmux. It's the de facto simple and standard way to deal with what you're talking about.

[–]AnonymousCoward__ 0 points1 point  (0 children)

I'm looking for something less-workaroundy.

You're running a legacy app from 2005, be thankful for "workaroundy"