Re: Fresh install misses autostart of daemon and faxgetty

Carsten <[email protected]> Sat, 1 Dec 2018 22:48:57 +0100
Newsgroups gmane.comp.telephony.fax.hylafax.user
Message-ID <[email protected]>
Am 01.12.18 um 18:11 schrieb Lee Howard:
> On 12/01/2018 05:43 AM, Carsten wrote:
>> after having a lot of trouble with the outdated version of hylafax I
>> now did a fresh install of version 5.6.1 from
>> http://hylafax.sourceforge.net
>>
>> My old hylafax version 3:6.0.6-6+deb8u1 from the repository has been
>> uninstalled and cleaned up by
>> "...
>> apt-get purge hylafax-server hylafax-client
>> mv /var/log/hylafax /var/log/hylafax-old
>> mv /var/spool/hylafax /var/spool/hylafax-old
>> mv /etc/hylafax /etc/hylafax-old
>> ..."
> HylaFAX is highly configurable.=C2=A0 Unless you take care to mimic the
> configuration and build that was done in your package-based installatio=
n
> there is a good chance that you'll find something is configured differe=
ntly.

Hi Lee and List,

"highly configurable" mostly means "We havn't made any thoughts about=20
other environments than our DEV. So look for Yourself to get it on"

;-)

I digged into it, and found some solutions according to Your ideas. Find=20
below the actual state of the issues (3/4 are resolved).

> To find out how the Debian packager did things you can dig through the
> source files:
>
> https://packages.debian.org/source/sid/hylafax
>
> What you'll find is that the Debian packager has done a lot of tweaking
> in order to cope with Debian packaging guidelines.=C2=A0 A lot of that =
you
> may not need or care about, and after you weed through it you'll find
> the bits that you're looking for.=C2=A0 It's a daunting task, but it's
> necessary if you're trying to mimic what you had before with the
> imposition of the packaging guidelines.
>
> As I do that now I notice that Debian patched v6.0.6 rather than
> updating to v6.0.7.=C2=A0 So, if you're going to v5.6.1 in order to get=
 the
> security update there is no need.
>
>> The Build of the new version went fine as far as I can see, just this
>> message confuses me:
>> "...
>> You do not appear to be using faxgetty to notify the HylaFAX scheduler
>> about new modems and/or their status.
>> ..."
> faxsetup will examine /etc/inittab for a specific pattern that it
> believes identifies a configuration that is "using faxgetty".=C2=A0 If =
that
> assumption is not met, then you'll get this message.=C2=A0 Many people =
will
> run faxgetty differently from that assumption, so this message is commo=
n
> to see.
>
> What you'll want to take note of, however, is that faxsetup does not
> create startup mechanisms for faxgetty.=C2=A0 Normally configuration of
> faxgetty startup was something left to the administrator of the system
> to do "manually".=C2=A0 However, some package installations (such as De=
bian)
> did this for you.
>
>> Remember, I have had a working send and receive configuration before,
>> using a postfix transport and faxgetty.
>>
>> issues:
>> ########################################
>> ##
>> ## #1 Transport not working anymore
>> ##
>> #########################################
>>
>> Error: cannot find /usr/bin/faxmail
> I'm guessing that your configuration put it in /usr/local/bin/faxmail.
> mail2fax.sh is different from faxmail.

It might be, that even the "faxmail" from the ophaned version was indeed=20
a script, just doing, what "mail2fax.sh" does.
Even from the workflow inside the script I can see, that the new hylafax=20
version seems to work some other way round.
So I guess the postfix transport can be set to

=3D> R.E.S.O.L.V.E.D

>> ########################################
>> ##
>> ## #2 Fax are not send
>> ##
>> ########################################
>>
>> After the workaround transport was working, I found the jobs in the
>> faxq folder, but they did not get send.
>>
>> I found neither faxgetty nor faxmodem seem to listen and as I could
>> not get faxgetty to work, I did a
>> faxmodem ttyIAX0
>> and the queued jobs were starting to be delivered.
>>
>> How do i get faxgetty involved?
> You'll need to start faxgetty for each modem somehow.=C2=A0 Using
> /etc/inittab was popular.=C2=A0 In modern days with systemd you'll prob=
ably
> want to create systemd "service" files.=C2=A0 If you're really lazy the=
n just
> putting a faxgetty line for each modem in an rc.local file would work,
> too, but it won't "respawn" them if they stop.
Thanks to that I took a deep breath and touched the bottom of the see.

I did some changes to the "/etc/init.d/hylafax" script adding "faxgetty"=20
to the "start" and "stop" functions and now it starts to work.
Here is a snipplett to give the idea:
"...
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 for THIS_MODEM in $(ls $SPOOL/etc/=
config.*|cut -d "." -f2); do
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if [ $(grep -i =
-c "^ModemType:"=20
$SPOOL/etc/config.$THIS_MODEM) -eq 1 ]; then
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0 $FAXGETTY $THIS_MODEM
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0 if [ "$?" =3D "0" ]; then
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0 =C2=A0=C2=A0=C2=A0 printf " faxgetty $THIS_MODEM"
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0 else
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0 =C2=A0=C2=A0=C2=A0 printf " FAILED: faxgetty $THIS_MODEM"
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0 fi
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fi
 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 done
..."
Even there is still some tweaking for the sake of stability needed, it=20
can be set to

=3D> R.E.S.O.L.V.E.D

>> ########################################
>> ##
>> ## #3 after reboot, hylafax does not come up automatically
>> ##
>> ########################################
>>
>> When restarting the system, I ended up w/o having a running hylafax
>> server.
>> Only a manual "service hylafax start" brings back the core, but still
>> there is no "faxgetty" process.
>>
>> I found some advice about to add the service to init.rc and tried this=
:
>> "...
>>  =C2=A0update-rc.d hylafax defaults 80 10
>> ..."
>> Ending up with this:
>> "...
>> insserv: Max recursions depth 99 reached
>> insserv: There is a loop at service hylafax if started
>> insserv: There is a loop at service rc.local if started
>> insserv:=C2=A0 loop involving service hylafax at depth 1
>> insserv: exiting now without changing boot order!
>> update-rc.d: error: insserv rejected the script header
>> ..."
>>
>> How do I get the configuration to start at boot (hylafax including
>> faxgetty)
> The lazy way to deal with this is to use rc.local to run "hylafax
> start".=C2=A0 But, the messages you're seeing there are because Debian
> expects a script header on the "hylafax" script.=C2=A0 Look for the
> "hylafax-server.hylafax.init" file in the
> "hylafax_6.0.6-8.1.debian.tar.xz" file.=C2=A0 You'll see the parts that
> Debian is expecting at the top of that script.


As before with "faxgetty" I tuned the "/etc/init.d/hylafax" file with=20
the missing information, and it works.
"...
### BEGIN INIT INFO
# Provides:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hylafax
# Required-Start:=C2=A0=C2=A0=C2=A0 $syslog
# Required-Stop:=C2=A0=C2=A0=C2=A0=C2=A0 $syslog
# Should-Start:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $local_fs $network
# Should-Stop:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $local_fs $network
# Default-Start:=C2=A0=C2=A0=C2=A0=C2=A0 2 3 4 5
# Default-Stop:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 1 6
# Short-Description: Start and stop the hylafax server
# Description:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Synchronize the /etc/h=
ylafax directory with
#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /var/spool/hylafax/etc and the=
n start hylafax
#=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 daemons. =
Otherwise stop all hylafax daemons.
### END INIT INFO
..."

=3D> R.E.S.O.L.V.E.D

>> ########################################
>> ##
>> ## #4 Delivery report returns rubbish Subject
>> ##
>> ########################################
>>
>> During the try and error from above I received some delivery reports.
>> I have had copied the "old" FaxDispatch and FaxNotify to the
>> /var/spool/hylafax/etc folder.
>>
>> Working with Thunderbird I receive a subject like this -not from the
>> source code, it is displayed like this:
>>
>> "=3D?UTF-8?B?w4T[..manyChars...]O2?=3D to 069[..faxnumber..] completed=
"
>>
>> What do I need to tweak here?
> It's possible that something in your FaxDispatch and FaxNotify scripts
> are not working properly with the v5.6.1 faxrcvd and notify scripts.
> Without looking at your modifications I don't know what you'd need to t=
weak.

At this point I have to add some informations regarding the needs of=20
switching to the current version of hylafax.
I have had a bunch of trouble with german special characters sending a=20
fax (UTF-8 support).

It looks like I hit this issue again, but this time may be related to=20
the "mail2fax.sh" script.
The body of the e-mail sent is perfect. All special characters like=20
"=C3=A4=C3=B6=C3=BC=C3=84=C3=96=C3=9C=C3=9F" are converted fine.
Just the subject, which includes in the first try only:
"=C3=84=C3=84=C3=84=C3=84=C3=9C=C3=9C=C3=9C=C3=9C=C3=96=C3=96=C3=96=C3=96=
=C3=96=C3=A4=C3=A4=C3=A4=C3=A4=C3=B6=C3=B6=C3=B6=C3=B6=C3=BC=C3=BC=C3=BC=C3=
=BC=C3=BC=C3=9F=C3=9F=C3=9F=C3=9F=C3=9F=C3=9F"
is converted to this:
"=3D?UTF-8?B?w4TDhMOEw4TDnMOcw5zDnMOWw5bDlsOWw5bDpMOkw6TDpMO2w7bDtsO2?=3D=
"
And every variation of this results in similar issues:
"Die B=C3=A4uerin gr=C3=B6hlt =C3=BCberlaut, da=C3=9F den K=C3=BChen die =
Milch sauer wird"
gets this:
"=3D?UTF-8?B?w4TDhMOEw4TDnMOcw5zDnMOWw5bDlsOWw5bDpMOkw6TDpMO2w7bDtsO2?=3D=
"
and even worth in the pdf-convertion it gets cut like this:
"Subject: =C3=831=E2=81=844hen die Milch sauer wird"

So again, I have an UTF-8 conversion issue left. This time with the subje=
ct.

Any idea?

br

Carsten

> All of this said, you seem fairly dependent upon the Debian packaging o=
f
> HylaFAX, and so I'm wondering why you're wanting to switch away from it=
. (?)
>
> Thanks,
>
> Lee.
>
>


____________________ HylaFAX(tm) Users Mailing List _____________________=
__
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.c=
gi
 On UNIX: mail -s unsubscribe [email protected] < /dev/nu=
ll
  *To learn about commercial HylaFAX(tm) support, mail [email protected].*