ttyd login only works with strace

Problems with packages? Post here, using [tags] of the package name.

ttyd login only works with strace

Postby bbeaudoin » Sat Aug 29, 2020 1:12 am

On Arch Linux ARM with all packages updated, including the latest util-linux-2.36-2, `login` does not appear to work as expected with other programs, such as `ttyd`. Unexpectedly using `strace` to debug causes it to work as expected (`strace ttyd login`). The issue appears to only affect Arch Linux ARM and could not be reproduced on other distributions or architectures.

For some embedded applications, using `ttyd` with `login` is used to provide a web terminal session and is the primary use case for running `login` without a terminal or `agetty` and it is unexpected for this not to work as well on Arch Linux ARM as it does on other architectures, such as Arch Linux 5.8.5-arch1-1 on x86, and other distributions.

Expected behavior:

1. The command `ttyd login` would permit login on http://127.0.0.1:7681 or from other hosts
2. The command `strace` would not be required for `ttyd login` to work

Actual behavior:

1. Without `strace`, the `login` command crashes repeatedly when the ttyd service is accessed.

Steps to reproduce:

1. Compile ttyd from source or download ttyd_linux.arm from the official releases (https://github.com/tsl0922/ttyd)
2. As root, execute `ttyd login` (with path if necessary)
3. Attempt to access the port on that machine with a web browser (http://127.0.0.1:7681 from the local host)
4. If failing, terminate the process and run `strace ttyd login` (with path if necessary)
5. Repeat access, it should no longer fail

Known Workarounds:

1. run `strace ttyd login`
2. copy the login binary from Raspbian or Ubuntu for armv7l and comment out the line starting with "FAIL_DELAY" in /etc/login.defs and run `ttyd /path/to/login` where "/path/to/login" is the login executable from Raspbian.

Additional Information:

After extensive testing, `ttyd login` works on all major distributions using `util-linux` on x86 platforms and on the armv7l platform distributions of Debian 10.3, Ubuntu 20.04 and Raspbian 10 using login-4.5-1.1 from https://github.com/shadow-maint/shadow. The Debian-based version of `login` for armv7l works on Arch Linux as expected, aside from a warning due to `FAIL_DELAY` not being a supported option in /etc/login.defs for that version of `login`.

Suspect, but have no information to support, that when `strace` attaches to the `ttyd` process it adds additional process overhead affecting the timing of the information getting to `login` from util-linux-2.36-2 on armv7l allowing it to function as expected. Please let me know if there is not enough information here to reproduce.
bbeaudoin
 
Posts: 3
Joined: Fri Aug 28, 2020 11:34 pm

Return to Packages

Who is online

Users browsing this forum: No registered users and 6 guests