<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 13, 2023 at 3:21 PM Giuseppe Sacco <<a href="mailto:giuseppe@sguazz.it">giuseppe@sguazz.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Il giorno lun, 13/02/2023 alle 12.12 +0200, Mantas Mikulėnas ha<br>
scritto:[...]<br>
> I'm not entirely sure whether it even makes sense for a .service unit<br>
> to wait for a specific pty? I mean, the entire design of ptys is that<br>
> they're assigned on a first-come basis and there's no way for a process<br>
> to claim a specific pty for itself, so there's no way for<br>
> faxgetty@.service to be sure that pty/0 is your fax thing and not e.g.<br>
> someone's xterm or an incoming SSH connection.<br>
> <br>
> What is supposed to be creating /dev/pts/0 in your case? It might be<br>
> simplest to have the same software directly start<br>
> faxgetty@<ptyname>.service as well.<br>
<br>
In this scenario, the ptys are created by software like iaxmodem (that uses<br>
asterisk) when its daemon starts. Some more information is available at<br>
Debian bug 1031200 (<a href="http://bugs.debian.org/1031200" rel="noreferrer" target="_blank">http://bugs.debian.org/1031200</a>) and a suggested<br>
solution is to change the unit and depend on the pty daemon service and on<br>
the a file system link in /dev that points to the real device in /dev/pty/<br>
(the link being created by the pty service at startup time).<br>
<br>
Something like:<br>
<br>
[Unit]<br>
Description=HylaFAX faxgetty %I<br>
Wants=iaxmodem.service dev-%i.device<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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?<br></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>