gelöst Hylafax Installation scheitert in Debian

Einrichten des Druckers und des Drucksystems, Scannerkonfiguration und Software zum Scannen und Faxen.
Antworten
Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 07.02.2023 13:54:51

Hallo zusammen :)

Ich hatte vor einiger Zeit angekündigt
Ich kann das übernehmen, weiß allerdings noch nicht genau, wann ich es in Angriff nehmen kann.
und nachdem ich mich in den letzten Wochen etwas zurückgezogen habe (andere Dinge haben mich mehr in Anspruch genommen als geplant), wollte ich mich nochmal melden.

Ich habe mich in den letzten Tagen mit dem Thema asterisk beschäftigt und in diesem Zusammenhang gleich eine VM mit eben diesem, sowie iaxmodem und hylafax erstellt.

Als erstes habe ich mich mit den udev-Regeln für den hylafax-server beschäftigt. Da hatte ja @JTH schon die Frage aufgeworfen
JTH hat geschrieben: ↑ zum Beitrag ↑
14.11.2022 20:51:40
sind die Rules evtl. generell Käse?
Ich denke ja. Vor dem Start von iaxmodem habe ich udevadm monitor -k ausgeführt, die Ausgabe blieb leer. Das bedeutet (so verstehe ich es zumindest), dass keine Kernelevents ausgelöst werden, demnach wird udev nicht aktiv und die Regel wird nicht ausgeführt. Das Gerät an sich ist aber vorhanden (letztendlich ein Symlink zu /dev/pts/...) und auch der faxgetty-Service kann darauf zugreifen. Wenn man die Suchmaschine mit den entsprechenden Stichwörtern füttert, trifft man auf einige wenige Treffer, die das gleiche Problem schildern, aber auch keine Lösung gefunden haben. Die Verwaltung von pts-Geräten scheint tatsächlich außerhalb von udev stattzufinden. Warum aber dann diese Regel? Es scheint, als ob einfach copy-paste gemacht und nicht getestet wurde.

Als nächstes habe ich dann den Hinweis von @HyP3r (Danke hierfür!) umgesetzt. Ich verstehe nicht warum, aber das Skript läuft anschließend durch und erkennt das Modem. Kann das jemand erklären? Die Schritte, die ausgeführt werden, sind dieselben. Warum verhält sich die Shell hier anders?

@Xantorix: Du hast mit deiner Patch-Aktion das Hylafax-Skript überschrieben. Du kannst zunächst probieren das Paket Debianhylafax-server neu zu installieren. Der Patch, den @HyP3r gepostet hatte, wurde mit Debiangit erstellt und hätte mit git apply <patch> angewendet werden können. Das Programm patch versteht die Syntax von git nicht, daher konnte das nicht funktionieren.

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 07.02.2023 18:00:32

Tintom hat geschrieben: ↑ zum Beitrag ↑
07.02.2023 13:54:51
@Xantorix: Du hast mit deiner Patch-Aktion das Hylafax-Skript überschrieben. Du kannst zunächst probieren das Paket Debianhylafax-server neu zu installieren. Der Patch, den @HyP3r gepostet hatte, wurde mit Debiangit erstellt und hätte mit git apply <patch> angewendet werden können. Das Programm patch versteht die Syntax von git nicht, daher konnte das nicht funktionieren.
Hallo, danke für die Antwort. Ich habe alles neu installiert und die Zeilen nicht als patch sondern händisch im "faxaddmodem" geändert.
Wie oben geschrieben lief der Modemtest durch aber am Ende kamen die oben geschriebenen Fehlermeldungen.
Wo liegt mein Fehler?

Gruß Xante

Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 07.02.2023 18:57:13

Xantorix hat geschrieben: ↑ zum Beitrag ↑
07.02.2023 18:00:32
Wo liegt mein Fehler?
In der manuellen Bearbeitung der Datei :wink:
In Zeile 2043 hast du ein fi stehen, welches dort nichts zu suchen hat. Zudem wird tr falsch aufgerufen, das liegt aber nicht an dir, sondern vermutlich am unerwarteten Rückgabewert vom Modem ("-").

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 07.02.2023 19:12:59

Wie verwende ich "git apply <patch>" ? Wo gebe ich die Zieldatei ein?

edit: Ich habe das patch als faxaddmodem.broken in das Verzeichnis mit faxaddmodem gelegt.

Ein "git apply faxaddmodem.broken" bringt "error: fehlerhafter Patch bei Zeile 30"

Hmm was nun?

edit: Ich hänge mal meine "faxaddmodem" hier hin. pastebin/?mode=view&s=41853

Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 11.02.2023 13:15:36

Xantorix hat geschrieben: ↑ zum Beitrag ↑
07.02.2023 19:12:59
Wie verwende ich "git apply <patch>" ? Wo gebe ich die Zieldatei ein?

edit: Ich habe das patch als faxaddmodem.broken in das Verzeichnis mit faxaddmodem gelegt.

Ein "git apply faxaddmodem.broken" bringt "error: fehlerhafter Patch bei Zeile 30"
Es gibt unzählige Anleitungen im Netz und in der Forensuche, die dir git viel besser erläutern können als ich es je könnte. Wenn du dich in git einarbeiten möchtest, dann nur zu! :THX:

Für die schnelle Änderung geht's auch ohne git:
  • Datei sichern:

    Code: Alles auswählen

    cp /usr/lib/hylafax/bin/faxaddmodem /beliebiger/pfad/zu/faxaddmodem.bak
  • entsprechende Zeilen ändern (als root):

    Code: Alles auswählen

    sed -i -e '807s/.*/\t\tshift\n\t\t${ONDELAY} $tdev $SH -c "$* >$OUT" \&\n\t\tcatpid=$!/g' -e '857s/.*/    pkill -9 - P $catpid; catpid=/g' /usr/lib/hylafax/bin/faxaddmodem
  • Änderung rückgängig machen (als root):

    Code: Alles auswählen

    cp /beliebiger/pfad/zu/faxaddmodem.bak /usr/lib/hylafax/bin/faxaddmodem

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 11.02.2023 14:23:27

Danke wiedermal.

Nach deiner Schnellvariante kommt nach dem Speedtest erst OK dann das:

Code: Alles auswählen

Probing for best speed to talk to modem: 38400 OK.
pkill: nur ein Muster kann angegeben werden
Rufen Sie »pkill --help« auf für weitere Informationen.

The result of the AT+FCLASS=? command was:

AT+FCLASS=?
OK
ATQ0V1E1
OK
0,1,1.0


We were unable to deduce what type of modem you have.  This means that
it did not respond as a Class 1, Class 2, or Class 2.0 modem should.
If you believe that your modem conforms to the Class 1, Class 2, or
Class 2.0 interface specification, then check that the modem is
operating properly and that you can communicate with the modem from the
host.  If your modem is not one of the above types of modems, then this
software does not support it and you will need to write a driver that
supports it.
Was nun? Gruß Xante

Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 11.02.2023 18:15:25

Xantorix hat geschrieben: ↑ zum Beitrag ↑
11.02.2023 14:23:27
Was nun?
Ignorieren.
Als Benutzer von hylafax kannst du die Einrichtung des Modems überspringen, deswegen hatten wir vor langer Zeit die Konfigurationsdateien kopiert, erinnerst du dich?
Das wird auch vom Autor von iaxmodem so vorgeschlagen:
/usr/share/doc/iaxmodem/README.gz hat geschrieben: ** USING IAX MODEM **

Once IAXmodem is running you are ready to use it with your application.

If your application is HylaFAX, there is a HylaFAX modem configuration
file included with IAXmodem (config.ttyIAX). The config file is for
HylaFAX version 4.2.2 and later. Instead of running faxaddmodem,
simply edit this config file to your liking and then copy it to
/var/spool/hylafax/etc/. (Run faxgetty and the rest of HylaFAX as
usual.)
//edit: Siehe auch das Posting von @JTH: viewtopic.php?p=1311807#p1311807

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 11.02.2023 20:48:53

Danke für die Info. Leider bekomme ich das im Moment nicht zum laufen.
Wahrscheinlich habe ich was bei der Neuinstallation von hylafax falsch gemacht.

faxstat bringt:

Code: Alles auswählen

faxstat: error while loading shared libraries: libhylafax-6.0.so.7: cannot open shared object file: No such file or directory
Wie bekomme ich das Ganze wieder sauber installiert?

Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 11.02.2023 21:28:02

Xantorix hat geschrieben: ↑ zum Beitrag ↑
11.02.2023 20:48:53
Wie bekomme ich das Ganze wieder sauber installiert?
Probiere apt reinstall hylafax-client

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 11.02.2023 21:40:33

Danke. Jetzt habe ich:

Code: Alles auswählen

faxstat
Can not reach service hylafax at host "localhost".

Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 11.02.2023 21:49:17

Ich denke es wäre jetzt Zeit für eine frische Neuinstallation bzw. Einspielen des letzten funktionierenden Backups. Du kannst nicht mehr nachvollziehen was an deinem System alles geändert wurde und der Rest des Forums kann es auch nicht.

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 13.02.2023 14:42:59

Tintom hat geschrieben: ↑ zum Beitrag ↑
11.02.2023 21:49:17
Ich denke es wäre jetzt Zeit für eine frische Neuinstallation
Genau das hatte ich getan um den patch durchzuführen.
Ich hatte asterisk, iaxmodem und hylafax neu installiert.
Gerne mache ich das nochmal. Ist kein Thema da ich das nur für meine abgehenden Faxe benötige.

Vielleicht waren da noch Reste der Altinstallation vorhanden.

Kann mir vielleicht nochmal jemand eine saubere Deinstallation incl. aller Konfigurationen zeigen?

Ich würde dann asterisk, iaxmodem und hylafax neu aufsetzen.

Danke Gruß Xante

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 04.03.2023 16:23:29

Hallo zusammen,

ich habe nun alles nochmal neu aufgesetzt.

Zuerst habe ich mit einem kleinen Skript alles entfernt.

Code: Alles auswählen

#!/bin/bash

# Stop all services
systemctl stop asterisk
systemctl stop hylafax
systemctl stop iaxmodem

# Remove asterisk
apt-get remove --purge asterisk

# Remove hylafax
apt-get remove --purge hylafax-server

# Remove iaxmodem
apt-get remove --purge iaxmodem

# Remove dependencies
apt-get autoremove --purge

# Remove configuration files
rm -rf /etc/asterisk
rm -rf /etc/hylafax
rm -rf /etc/iaxmodem

# Remove user data
rm -rf /usr/lib/hylafax/bin
rm -rf /var/lib/asterisk
rm -rf /var/spool/asterisk
rm -rf /var/spool/hylafax
rm -rf /var/spool/iaxmodem
rm -rf /var/spool/fax
rm -rf /var/spool/sms
rm -rf /var/spool/voice

# Remove log files
rm -rf /var/log/asterisk
rm -rf /var/log/hylafax
rm -rf /var/log/iaxmodem

# Remove user accounts
userdel -r fax
userdel -r hylafax
userdel -r asterisk
userdel -r iaxmodem
Danach habe ich aus den Paketquellen asterisk, iaxmodem und hylafax neu installiert.
Bei hylafax habe ich

Code: Alles auswählen

sed -i -e '807s/.*/\t\tshift\n\t\t${ONDELAY} $tdev $SH -c "$* >$OUT" \&\n\t\tcatpid=$!/g' -e '857s/.*/    pkill -9 - P $catpid; catpid=/g' /usr/lib/hylafax/bin/faxaddmodem
verwendet.

Bei "faxsetup" läuft der Modemtemtest durch dann kommen aber Fehlermeldungen und am Schluß funktioniert es natürlich nicht. So sieht es aus:

Code: Alles auswählen

Probing for best speed to talk to modem: 38400 OK.
pkill: nur ein Muster kann angegeben werden
Rufen Sie »pkill --help« auf für weitere Informationen.

About fax classes:

The difference between fax classes has to do with how HylaFAX interacts
with the modem and the fax protocol features that are used when sending
or receiving faxes.  One class isn't inherently better than another;
however, one probably will suit a user's needs better than others.
    
Class 1 relies on HylaFAX to perform the bulk of the fax protocol.
Class 2 relies on the modem to perform the bulk of the fax protocol.
Class 2.0 is similar to Class 2 but may include more features.
Class 1.0 is similar to Class 1 but may add V.34-fax capability.
Class 2.1 is similar to Class 2.0 but adds V.34-fax capability.
      
HylaFAX generally will have more features when using Class 1/1.0 than
when using most modems' Class 2 or Class 2.0 implementations.  Generally
any problems encountered in Class 1/1.0 can be resolved by modifications
to HylaFAX, but usually any problems encountered in Class 2/2.0/2.1 will
require the modem manufacturer to resolve it.

Use Class 1 unless you have a good reason not to.

This modem looks to have support for Class 1.0 and 1.
How should it be configured [1.0]? 1

Hmm, this looks like a Class 1 modem.
pkill: nur ein Muster kann angegeben werden
Rufen Sie »pkill --help« auf für weitere Informationen.
Product code (ATI0) is "".
pkill: nur ein Muster kann angegeben werden
Rufen Sie »pkill --help« auf für weitere Informationen.
/usr/lib/hylafax/bin/faxaddmodem: Zeile 863: Warnung: Kommandoersetzung: NULL-Byte in der Eingabe ignoriert.
Other information (ATI3) is "www.soft-switch.org".
DTE-DCE flow control scheme [default]? 
Modem manufacturer is "Unknown".
Modem model is "Unknown".

Using prototype configuration file class1...

There is no prototype configuration file for your modem, so we will
have to fill in the appropriate parameters by hand.  You will need the
manual for how to program your modem to do this task.  In case you are
uncertain of the meaning of a configuration parameter you should
consult the config(5) manual page for an explanation.

Note that modem commands must be specified exactly as they are to be
sent to the modem.  Note also that quote marks (") will not be displayed
and will automatically be deleted.  You can use this facility to supply
null parameters as "".

Finally, beware that the set of parameters is long.  If you prefer to
use your favorite editor instead of this script you should fill things
in here as best you can and then edit the configuration file

"/var/spool/hylafax/etc/config.ttyIAX0"

after completing this procedure.

Command to enter Class 1 [AT+FCLASS=1]? 
Command to stop and wait prior to sending PPM [AT+FTS=7]? 
Command to stop and wait prior to sending TCF [AT+FTS=7]? 
Command to stop and wait prior to sending EOP [AT+FTS=9]? 
Extra bytes in a received HDLC frame [4]? 
Maximum time to wait for OK after aborting a receive (ms) [200]? 
Maximum wait for initial identification frame (ms) [40000]? 
Command to ensure silence after receiving HDLC and before sending [AT+FRS=7]? 

The modem configuration parameters are:

Class1Cmd:		AT+FCLASS=1
Class1PPMWaitCmd:	AT+FTS=7
Class1TCFWaitCmd:	AT+FTS=7
Class1EOPWaitCmd:	AT+FTS=9
Class1FrameOverhead:	4
Class1RecvAbortOK:	200
Class1RecvIdentTimer:	40000
Class1SwitchingCmd:	AT+FRS=7
Class1TCFMaxNonZero:	10
Class1TCFMinRun:	1000

Are these ok [yes]? 

Creating new configuration file /var/spool/hylafax/etc/config.ttyIAX0...
Creating fifo /var/spool/hylafax/FIFO.ttyIAX0 for faxgetty... done.
Done setting up the modem configuration.

Checking /var/spool/hylafax/etc/config for consistency...
...everything looks ok; leaving existing file unchanged.
tr: zusätzlicher Operand „-“
Beim Löschen ohne Verdichten darf nur eine Zeichenkette angegeben werden.
„tr --help“ liefert weitere Informationen.
Created symlink /etc/systemd/system/hylafax.service.wants/faxq.service → /lib/systemd/system/faxq.service.
A new systemd service has been created and enabled for this device.
You may run it with command: systemctl start faxgetty@.service
/usr/lib/hylafax/bin/faxaddmodem: Zeile 2041: Syntaxfehler beim unerwarteten Symbol »fi«
/usr/lib/hylafax/bin/faxaddmodem: Zeile 2041: `fi'
umount: /var/spool/hylafax/etc: target is busy.
Do you want to run faxaddmodem to configure another modem [yes]? no

You do not appear to be using faxgetty to notify the HylaFAX scheduler
about new modems and/or their status.  This means that you must use the
faxmodem program to inform the new faxq process about the modems you
want to have scheduled by HylaFAX.  Beware that if you have modems that
require non-default capabilities specified to faxmodem then you should
read faxmodem(8) manual page and do this work yourself (since this
script is not intelligent enough to automatically figure out the modem
capabilities and supply the appropriate arguments).

Should I run faxmodem for each configured modem [yes]? no

Done verifying system setup.
umount: /var/spool/hylafax/etc: target is busy.
root@omv-office:/usr/lib/hylafax/bin# systemctl start faxgetty@.service
Failed to start faxgetty@.service: Unit name faxgetty@.service is missing the instance name.
See system logs and 'systemctl status faxgetty@.service' for details.
root@omv-office:/usr/lib/hylafax/bin# faxstat
Can not reach service hylafax at host "localhost".
Ich bräuchte hier nochmal eure Hilfe.
Danke Xante

Benutzeravatar
Tintom
Moderator
Beiträge: 3029
Registriert: 14.04.2006 20:55:15
Wohnort: Göttingen

Re: Hylafax Installation scheitert in Debian

Beitrag von Tintom » 10.03.2023 23:02:38

Ich wollte noch ein Update zu dem Thema geben. Eigentlich wollte ich gar nicht so tief einsteigen, aber nun ja...

Ich habe die fehlerhafte systemd unit von faxgetty zum Anlass genommen und einen Bugreport gegen hylafax-server gestellt (Debian Bugreport1031200). Der Maintainer von hylafax, Giuseppe Sacco, hat sich dem direkt angenommen und so wurde das Thema bereits auf der udev-Mailingliste und der iaxmodem-Mailingliste diskutiert.

Das zwischenteitliche Fazit: Die udev-Regel für das ttyIAX-Gerät in Debian funktionieren so nicht, man ist aber offen für einen Patch, der diese Funktionalität bereitstellen würde.

Interessant waren für mich aber vor allem die Details, die erklären würden, warum die Kombination aus hylafax + iaxmodem in letzter Zeit gerne mal hakt:

1) Das Debianpaket basiert auf einer uralten Version von hylafax, welche seit Jahren nicht mehr weiter entwickelt wird.
2) Vor einigen Jahren wurde hylafax 'geforkt', der Fork trägt den Namen Hylafax+ und wird noch heute weiter entwickelt.
3) Der Maintainer von hylafax hat vor einiger Zeit einen ITP-Bug für Hylafax+ erstellt (Debian Bugreport956439) um Hylafax+ für Debian bereitzustellen. Passiert ist seitdem aber wohl nichts.
4) Der Entwickler von iaxmodem ist gleichzeitig einer der Entwickler von Hylafax+ und verwendet eben ausschließlich dieses in Kombination mit iaxmodem.
5) Aufgrund von 4) hat der Entwickler von iaxmodem kein Interesse seine Software gegen das alte hylafax zu testen.

Das bedeutet für mich, das Paket hylafax ist eigentlich in der jetzigen Form tot. Ich denke auch nicht, dass der Bugreport noch gelöst wird. An sich aber kein Problem, man könnte ein-/ausgehende Faxe auch über asterisk über die Funktion SendFax() und ReceiveFax() und einem einfachen Webfax- bzw. Mailfax-Skript kombinieren, welche man zuhauf bei github findet. Eine fertige Debianlösung gibt es allerdings noch nicht.

Xantorix
Beiträge: 177
Registriert: 27.01.2018 13:33:06

Re: Hylafax Installation scheitert in Debian

Beitrag von Xantorix » 13.03.2023 09:57:03

Hallo und Danke für die tiefgreifende Hilfe.
Zusammenfassend ist das für mich leider so noch nicht praktikabel.
Ich tendiere jetzt eher dazu mir in mein Debian bullseye ein zweites Debian buster zu stricken.
Dieses alte Debian bekommt dann nur die Faxlösung. Aber das wird ein neues Thema.
Wenn ich diesen Weg nicht praktikabel bekomme wird es wohl der Raspberry Pi obwohl mir eine Lösung ohne extra Hardware lieber wäre.

Gruß Xante

edit: Ich habe meine Lösung mit KVM und buster realisiert. Nochmal vielen Dank. Für mich gelöst.

Antworten