On Mon, Feb 13, 2023 at 3:21 PM Giuseppe Sacco <giuseppe@xxxxxxxxx> wrote:
Il giorno lun, 13/02/2023 alle 12.12 +0200, Mantas Mikulėnas ha
scritto:[...]
> I'm not entirely sure whether it even makes sense for a .service unit
> to wait for a specific pty? I mean, the entire design of ptys is that
> they're assigned on a first-come basis and there's no way for a process
> to claim a specific pty for itself, so there's no way for
> faxgetty@.service to be sure that pty/0 is your fax thing and not e.g.
> someone's xterm or an incoming SSH connection.
>
> What is supposed to be creating /dev/pts/0 in your case? It might be
> simplest to have the same software directly start
> faxgetty@<ptyname>.service as well.
In this scenario, the ptys are created by software like iaxmodem (that uses
asterisk) when its daemon starts. Some more information is available at
Debian bug 1031200 (http://bugs.debian.org/1031200) and a suggested
solution is to change the unit and depend on the pty daemon service and on
the a file system link in /dev that points to the real device in /dev/pty/
(the link being created by the pty service at startup time).
Something like:
[Unit]
Description=HylaFAX faxgetty %I
Wants=iaxmodem.service dev-%i.device
I can't see how that would work. Udev doesn't issue events for symlinks – a symlink to something that's not a "device" is still not a device.
Would it be enough to order faxgetty After=iaxmodem.service, i.e. wait until it has created *all* of the ptys that it was set up to create? Are they preconfigured or do they show up dynamically?
Mantas Mikulėnas