<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 13, 2023 at 5:16 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">Hello Mantas,<br>
<br>
Il giorno lun, 13/02/2023 alle 14.32 +0100, Giuseppe Sacco ha scritto:<br>
> Il giorno lun, 13/02/2023 alle 15.25 +0200, Mantas Mikulėnas ha scritto:<br>
> > On Mon, Feb 13, 2023 at 3:21 PM Giuseppe Sacco <<a href="mailto:giuseppe@sguazz.it" target="_blank">giuseppe@sguazz.it</a>><br>
> > wrote:<br>
> > > [...]<br>
> > > In this scenario, the ptys are created by software like iaxmodem<br>
> > > (that uses<br>
> > > asterisk) when its daemon starts. Some more information is available<br>
> > > 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<br>
> > > and<br>
> > > on<br>
> > > the a file system link in /dev that points to the real device in<br>
> > > /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>
> > <br>
> > I can't see how that would work. Udev doesn't issue events for symlinks<br>
> > –<br>
> > a symlink to something that's not a "device" is still not a device.<br>
> <br>
> Yes, that's my point of view too. That's way I am asking here.<br>
> <br>
> > Would it be enough to order faxgetty After=iaxmodem.service, i.e. wait<br>
> > until it has created *all* of the ptys that it was set up to create?<br>
> > Are<br>
> > they preconfigured or do they show up dynamically?<br>
> <br>
> I don't know. I am going to check.<br>
<br>
The link in /dev is created by the iaxmodem service when it starts, and<br>
deleted when it stops. I think you may configure more than one line in<br>
iaxmodem, so you will have many links, like /dev/ttyIAX0 and /dev/ttyIAX1.<br>
<br>
BTW, this seems to be working: the dev-%i.device listed in Wants, even if<br>
it only refers to a link, seems to be working.<br></blockquote><div><br></div><div>If you mean the service starts, then it's only working as in "it does nothing at all" – Wants= does not imply After=, and a plain Wants= without After= just becomes a no-op if it refers to an nonexistent unit. It might as well be "Wants=dev-foobar.device".</div><div><br></div><div>Wants= *with* After= would wait for the .device to appear even if it 
doesn't exist (I think that's special-cased for .device and .mount dependencies), but if you tried to use a symlink to a non-device you'd likely get a "Timed out waiting for dev-ttyFOO.device".</div></div><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>