Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wish: Provide systemd service file for people to use. #19

Open
markstos opened this issue Mar 21, 2017 · 2 comments
Open

Wish: Provide systemd service file for people to use. #19

markstos opened this issue Mar 21, 2017 · 2 comments

Comments

@markstos
Copy link

Right now when sshtron is run by systemd, the colors don't work. See:

http://unix.stackexchange.com/questions/352937/ansi-colors-when-using-systemd-service

From what I can tell, sshtron uses a color library, which in turn uses library to check is there's a terminal connected to decide whether to use colors or not, which boils down to this line:

https://github.com/mattn/go-isatty/blob/master/isatty_linux.go#L14

The logic using TTY detection to decide if a server should output color seems flawed if that's what' going on. The server might be not connected to a TTY even if the clients are.

systemd does have some options to connect a service to a TTY documented in man systemd.exec, but usually services aren't connected to TTYs, their clients are.

In any event, providing a working systemd .service file would be of interest to people who want to manage sshtron as a standard system service.

@alyyousuf7
Copy link
Collaborator

I got it working in color under a Docker container by attaching it to tty with docker run -t.
See this PR #20

@zachlatta
Copy link
Owner

Thanks for the PR @ali-yousuf-10p! Just merged it.

@markstos: totally with you & think that providing a systemd service would be awesome. Any chance you'd be interested in submitting a PR for that?

Work's crazy for me right now and I don't think I'll have a chance to get to this for at least a few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants