runit: run process in a tty

From: Kian Kasad <kian_at_kasad.com>
Date: Fri, 16 Oct 2020 17:35:45 -0700

I'm trying to have a runit service spawn `/usr/bin/ly` in a certain tty
(tty2). I've tried redirecting std{in,out,err} to the tty:

exec /usr/bin/ly </dev/tty2 >/dev/tty2 2>&1

but this didn't work.

I tried the openvt(1) program, which has a flag `-e` to exec the program
instead of forking it:

openvt -ec 2 /usr/bin/ly

This returned an error:
Unable to open file: /dev/tty2: Operation not permitted.

However, openvt(1) works when using the `-w` (wait) flag instead of `-e`
(exec). So my questions are:
- Does anyone know why this happens?
- Is there a better way to spawn a process on a certain tty with runit?

Thanks,
Kian Kasad



Received on Sat Oct 17 2020 - 00:35:45 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC