Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1031200: hylafax-server: faxgetty.service doesn't work with iaxmodem

101 views
Skip to first unread message

Tino Schmidt

unread,
Feb 13, 2023, 1:40:04 AM2/13/23
to
Package: hylafax-server
Version: 3:6.0.7-3.1
Severity: important
X-Debbugs-Cc: debian...@dc0wh17f.mooo.com

Dear Maintainer,

as mentioned in https://debianforum.de/forum/viewtopic.php?t=185052 (German, VERY long) there seems to be an issue with faxgetty's service unit in combination with the shipped udev rules of the package when hylafax is configured with iaxmodem.

When properly configured, iaxmodem creates a device /dev/ttyIAX<n> which is a symlink to /dev/pts/<n>. The appearance of the device does not result in an udev event, since events under /dev/pts/ didn't seem to be covered by udev.

The symlink is also created by iaxmodem itself. Hence, the shipped udev rules (/lib/udev/rules.d/60-hylafax-server.rules) do not come into action, so a line like
KERNEL=="ttyIAX0", SYMLINK="ttyIAX0", TAG+="systemd"
is ignored.

This is fatal, because the attached systemd-tag is necessary for creating device files which are required by faxgetty's systemd-unit (/lib/systemd/system/faxgetty@.service):

[Unit]
Description=HylaFAX faxgetty %I
BindsTo=dev-%i.device
After=dev-%i.device

So, faxgetty.service is waiting for a device that never shows up.

As a temporary workaround the BindsTo and After lines were replaced with a more soft dependency, so it looks like this:

[Unit]
Description=HylaFAX faxgetty %I
Wants=iaxmodem.service dev-%i.device

After that faxgetty started successfully.

Please provide a fix for this.

Thanks,
Tino


-- System Information:
Debian Release: 11.1
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 5.10.0-21-686-pae (SMP w/1 CPU thread)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hylafax-server depends on:
ii adduser 3.118
ii bsd-mailx [mailx] 8.1.2-0.20180807cvs-2
ii debconf [debconf-2.0] 1.5.77
ii exim4-daemon-light [mail-transport-agent] 4.94.2-7
ii ghostscript 9.53.3~dfsg-7+deb11u2
ii hylafax-client 3:6.0.7-3.1
ii init-system-helpers 1.60
ii libc6 2.31-13+deb11u5
ii libcrypt1 1:4.4.18-4
ii libgcc-s1 10.2.1-6
ii libjbig0 2.1-3.1+b2
ii libpam0g 1.4.0-9+deb11u1
ii libstdc++6 10.2.1-6
ii libtiff-tools 4.2.0-1+deb11u3
ii libtiff5 4.2.0-1+deb11u3
ii lsb-base 11.1.0
ii psmisc 23.4-2
ii sed 4.7-1
ii systemd 247.3-6
ii zlib1g 1:1.2.11.dfsg-2+deb11u2

hylafax-server recommends no packages.

Versions of packages hylafax-server suggests:
pn mgetty <none>
pn psrip <none>

-- Configuration Files:
/etc/hylafax/hosts.hfaxd [Errno 13] Keine Berechtigung: '/etc/hylafax/hosts.hfaxd'

-- debconf information excluded

Giuseppe Sacco

unread,
Feb 13, 2023, 3:30:04 AM2/13/23
to
Hello Tino,
I will ask on the udev mailing list in order to find the best solution.
I do have a question, is this "Wants" line working even when you have more
then one IAX modem?

> Wants=iaxmodem.service dev-%i.device


Thank you,
Giuseppe

debian...@dc0wh17f.mooo.com

unread,
Feb 13, 2023, 6:00:04 AM2/13/23
to
Hello Giuseppe,
thank you for working on this and responding so quickly.
Yes, the Wants line is also working with two or more iax modems.


Tino

Giuseppe Sacco

unread,
Feb 13, 2023, 8:40:04 AM2/13/23
to
Hello,

Il giorno lun, 13/02/2023 alle 10.41 +0000, debian...@dc0wh17f.mooo.com
ha scritto:
> Hello Giuseppe,
> thank you for working on this and responding so quickly.
> Yes, the Wants line is also working with two or more iax modems.

Does iaxmodem create the link in /dev when you configure the line, or when
it starts up? Is the link present when iaxmodem service is stopped?

Thank you,
Giuseppe

debian...@dc0wh17f.mooo.com

unread,
Feb 13, 2023, 10:10:05 AM2/13/23
to
> Does iaxmodem create the link in /dev when you configure the line, or when
> it starts up?
It's created at the start of iaxmodem.

> Is the link present when iaxmodem service is stopped?
No.

debian...@dc0wh17f.mooo.com

unread,
Feb 13, 2023, 6:00:06 PM2/13/23
to
Hello Giuseppe,
from my point of view all we need is a logical OR (||) in this systemd unit. Unfortunately I couldn't find such an option in systemd's manpages. So, I gave it a shot and tried this:

[Unit]
Description=HylaFAX faxgetty %I
BindsTo=iaxmodem.service || dev-%i.device
After=network.target

Well, it works as expected: The devices come up and if I stop iaxmodem.service manually, all faxgetty services are immediately terminated as well. If I start faxgetty again, iaxmodem.service is started automatically. This is just for the iaxmodem part, I couldn't test with a real serial modem though.

The After line is to make sure iaxmodem.service is running if faxgetty wants to start an iax device.

But, again, I am not sure if this logical OR is officially supported by systemd.


Tino

Giuseppe Sacco

unread,
Feb 14, 2023, 3:10:04 AM2/14/23
to
Hi Tino,

Il giorno lun, 13/02/2023 alle 22.47 +0000, debian...@dc0wh17f.mooo.com
ha scritto:
> Hello Giuseppe,
> from my point of view all we need is a logical OR (||) in this systemd
> unit. Unfortunately I couldn't find such an option in systemd's manpages.
> So, I gave it a shot and tried this:
>
> [Unit]
> Description=HylaFAX faxgetty %I
> BindsTo=iaxmodem.service || dev-%i.device
> After=network.target
[...]

The problem is if we may just wait for iaxmodem or if we need to wait for
the device.
The dev-%i.device has events when udev sends them, but since that path is
not a real device, no udev events are sent. This probably means that using
dev-%i.device on any systemd unit is useless.
So, I am wondering if the minimal working unit is just

[Unit]
Description=HylaFAX faxgetty %I
BindsTo=iaxmodem.service
After=iaxmodem.service

The question is: could you confirm that you cannot add/remove/start/stop
IAX devices without stopping the iaxmodem.service? In other words, no
(device) events would be possibile once iaxmodem is started?

Thank you,
Giuseppe

debian...@dc0wh17f.mooo.com

unread,
Feb 14, 2023, 8:00:05 AM2/14/23
to
Hi Giuseppe,

> The problem is if we may just wait for iaxmodem or if we need to wait for
> the device.
I agree.


> The dev-%i.device has events when udev sends them, but since that path is
> not a real device, no udev events are sent. This probably means that using
> dev-%i.device on any systemd unit is useless.
I don't think they're useless. The intended behavior (from my understanding) of BindsTo=dev-%i.device is, to make sure faxgetty binds to that device and start it once the device becomes available or terminate it immediately when the underlying real device (say: /dev/ttyS0) is not available anymore. Therefore, the BindsTo-dependency makes sense to me. And this is why I wanted to keep them and add iaxmodem.service in this line with an OR statement, which seems not to be supported by systemd.


> So, I am wondering if the minimal working unit is just
>
> [Unit]
> Description=HylaFAX faxgetty %I
> BindsTo=iaxmodem.service
> After=iaxmodem.service
This works.


> The question is: could you confirm that you cannot add/remove/start/stop
> IAX devices without stopping the iaxmodem.service? In other words, no
> (device) events would be possibile once iaxmodem is started?
No. You can add/remove devices with a seperate call of iaxmodem <configfile> while iaxmodem.service is running. You can even (re)start running devices. There is no lock or similar for a device once iaxmodem is started.


Thanks,
Tino

Giuseppe Sacco

unread,
Feb 17, 2023, 7:30:04 AM2/17/23
to
Hello Tino,

Il giorno mar, 14/02/2023 alle 12.54 +0000, debian...@dc0wh17f.mooo.com
ha scritto:
> [...]
> > The question is: could you confirm that you cannot
> > add/remove/start/stop
> > IAX devices without stopping the iaxmodem.service? In other words, no
> > (device) events would be possibile once iaxmodem is started?
> No. You can add/remove devices with a seperate call of iaxmodem
> <configfile> while iaxmodem.service is running. You can even (re)start
> running devices. There is no lock or similar for a device once iaxmodem
> is started.

Could you please verify if any of the proposed configuration works also
when adding/removing a new IAX device when iaxmodem is already up and
running?

Thank you,
Giuseppe

debian...@dc0wh17f.mooo.com

unread,
Feb 19, 2023, 2:40:05 PM2/19/23
to
Hi Giuseppe,

> > [...]
> > The question is: could you confirm that you cannot
> > add/remove/start/stop
> > IAX devices without stopping the iaxmodem.service? In other words, no
> > (device) events would be possibile once iaxmodem is started?
> > No. You can add/remove devices with a seperate call of iaxmodem
> > <configfile> while iaxmodem.service is running. You can even (re)start
> > running devices. There is no lock or similar for a device once iaxmodem
> > is started.
> >
>
> Could you please verify if any of the proposed configuration works also
> when adding/removing a new IAX device when iaxmodem is already up and
> running?
Same. I think the behavior is not a systemd issue but an issue of iaxmodem. Once iaxmodem is started, it reads all available config files and assigns any existing symlinks to a new device of /dev/pts/<n>. It doesn't check if it's already running and just overwrites existing symlinks. It doesn't terminate itself either, so any previously started process of iaxmodem remains still active. So, when I type /usr/bin/iaxmodem two times, the result with two available configfiles under /etc/iaxmodem is four iaxmodem processes running at the same time.

As far as I understand the code of iaxmodem.c this is the intended behavior (which, for me, is wrong). Maybe I should file a bug report against iaxmodem first before we work on faxgetty's systemd unit - what do you think?


Thanks,
Tino

Giuseppe Sacco

unread,
Feb 19, 2023, 4:30:04 PM2/19/23
to
Il giorno dom, 19/02/2023 alle 19.26 +0000, debian...@dc0wh17f.mooo.com ha
scritto:
> Hi Giuseppe,
> > [...]
> > Could you please verify if any of the proposed configuration works also
> > when adding/removing a new IAX device when iaxmodem is already up and
> > running?
> Same. I think the behavior is not a systemd issue but an issue of iaxmodem.
> Once iaxmodem is started, it reads all available config files and assigns
> any existing symlinks to a new device of /dev/pts/<n>. It doesn't check if
> it's already running and just overwrites existing symlinks. It doesn't
> terminate itself either, so any previously started process of iaxmodem
> remains still active. So, when I type /usr/bin/iaxmodem two times, the
> result with two available configfiles under /etc/iaxmodem is four iaxmodem
> processes running at the same time.
>
> As far as I understand the code of iaxmodem.c this is the intended behavior
> (which, for me, is wrong). Maybe I should file a bug report against iaxmodem
> first before we work on faxgetty's systemd unit - what do you think?

you may probably just write to iaxmodem-users mailing lists. I already
contacted the author there and he is aware of this Debian bug.

Bye,
Giuseppe
0 new messages