NetBSD Problem Report #18681
Received: (qmail 28663 invoked by uid 605); 17 Oct 2002 15:41:24 -0000
Message-Id: <200210171515.g9HFFM108213@pizza.causeuse.org>
Date: Thu, 17 Oct 2002 17:15:23 +0200 (CEST)
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@gnats.netbsd.org
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Subject: comms/hylafax 'faxd' started unconditionally
X-Send-Pr-Version: 3.95
>Number: 18681
>Category: pkg
>Synopsis: rc.d script does not allow starting hfaxd through inetd
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 17 15:42:00 +0000 2002
>Closed-Date:
>Last-Modified: Fri Oct 18 09:12:00 +0000 2002
>Originator: Hauke Fath <hauke@espresso.rhein-neckar.de>
>Release: NetBSD 1.6
>Organization:
Einzeln auftretender Radfahrer
>Environment:
System: NetBSD pizza.causeuse.org 1.6 NetBSD 1.6 (PIZZA) #1:
Wed Sep 11 23:26:21 CEST 2002
hauke@pizza.causeuse.org:/usr/src/sys/arch/sparc/compile/PIZZA sparc
Architecture: sparc
Machine: sparc
# $NetBSD: hylafax.sh,v 1.4 2002/09/20 02:01:55 grant Exp $
>Description:
The hylafax 'hfaxd' can be operated standalone, or from
inetd. The latter makes sense for a small site sending a few
faxes a day.
The '/etc/rc.d/hylafax' script starts 'hfaxd' unconditionally,
blocking the inetd option.
>How-To-Repeat:
Install comms/hylafax, then set up a hfaxd entry in
inetd.conf; wonder why it does not work.
>Fix:
Apply the equivalent of the following patch to see whether
hfaxd is started by inetd before starting it standalone:
--- /usr/pkg/etc/rc.d/hylafax Thu Oct 17 16:54:13 2002
+++ /etc/rc.d/hylafax Wed Jun 26 22:38:00 2002
@@ -10,9 +10,12 @@
case ${command} in
start)
if [ -x /usr/pkg/libexec/hfaxd -a -f /var/spool/hylafax/etc/config ] ; then
- echo -n 'Starting hfaxd'
- /usr/pkg/libexec/hfaxd -i 4559 -o 4557 -s 444
-
+ echo -n 'Starting'
+ # start hfaxd standalone if not run by inetd
+ if ! `egrep '^[^#]+hfaxd.+$' /etc/inetd.conf >/dev/null`; then
+ echo -n ' hfaxd'
+ /usr/pkg/libexec/hfaxd -i 4559 -o 4557 -s 444
+ fi
echo ' faxq.'
/usr/pkg/sbin/faxq
fi
>Release-Note:
>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: netbsd-bugs@netbsd.org, <gnats-bugs@gnats.netbsd.org>
Subject: Re: pkg/18681: comms/hylafax 'faxd' started unconditionally
Date: Thu, 17 Oct 2002 09:11:15 -0700 (PDT)
On Thu, 17 Oct 2002, Hauke Fath wrote:
> The '/etc/rc.d/hylafax' script starts 'hfaxd' unconditionally,
> blocking the inetd option.
I think instead of checking for inetd.conf setting for it, the
rc.d/hylafax script should be fixed to use the proper rc.d file syntax.
Then it would not run automatically unless "hylafax=yes" was set in
rc.conf.
Maybe like:
. /etc/rc.subr
name="hylafax"
procname="hfaxd"
rcvar=$name
command="@PREFIX@/libexec/hfaxd"
pidfile="/var/run/hfaxd.pid"
required_files="/var/spool/${name}/etc/config"
load_rc_config $name
run_rc_command "$1"
(Not tested. Also, could use "hfaxd" as name instead. Also, since it
could be used on non-NetBSD systems maybe this could be made to check for
/etc/rc.subr like the apache and cupsd commands do.)
Then if you want inetd then use inetd.conf and don't set "hylafax=yes".
(By the way, /var/spool/hylafax/etc/config seems like a strange, non-pkg
file location.)
Jeremy C. Reed
http://bsd.reedmedia.net/
From: Lubomir Sedlacik <salo@Xtrmntr.org>
To: "Jeremy C. Reed" <reed@reedmedia.net>
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>, netbsd-bugs@netbsd.org,
gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/18681: comms/hylafax 'faxd' started unconditionally
Date: Thu, 17 Oct 2002 18:20:47 +0200
hi,
On Thu, Oct 17, 2002 at 09:11:15AM -0700, Jeremy C. Reed wrote:
> On Thu, 17 Oct 2002, Hauke Fath wrote:
>=20
> > The '/etc/rc.d/hylafax' script starts 'hfaxd' unconditionally,
> > blocking the inetd option.
>=20
> I think instead of checking for inetd.conf setting for it, the
> rc.d/hylafax script should be fixed to use the proper rc.d file
> syntax. Then it would not run automatically unless "hylafax=3Dyes" was
> set in rc.conf.
i agree. but also don't forget to provide generic rc script which will
work for other operating systems.
regards,
--=20
-- Lubomir Sedlacik <salo@Xtrmntr.org> ASCII Ribbon campaign against /"\=
--
-- <salo@silcnet.org> e-mail in gratuitous HTML and \ /=
--
-- Microsoft proprietary formats X =
--
-- PGPkey: http://Xtrmntr.org/salo.pgp / \=
--
-- Key Fingerprint: 75B2 2B96 CD75 0385 1C49 39B8 8B08 C30E 54BC 7263 =
--
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: "Jeremy C. Reed" <reed@reedmedia.net>
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>, netbsd-bugs@netbsd.org,
<gnats-bugs@gnats.netbsd.org>
Subject: Re: pkg/18681: comms/hylafax 'faxd' started unconditionally
Date: Thu, 17 Oct 2002 21:14:27 +0200
At 9:11 Uhr -0700 17.10.2002, Jeremy C. Reed wrote:
>> The '/etc/rc.d/hylafax' script starts 'hfaxd' unconditionally,
>> blocking the inetd option.
>
>I think instead of checking for inetd.conf setting for it, the
>rc.d/hylafax script should be fixed to use the proper rc.d file syntax.
>Then it would not run automatically unless "hylafax=yes" was set in
>rc.conf.
The problem here is that rc.d/hylafax starts _two_ daemons:
o hfaxd, which is used for client communication and can be run from inetd
as well as standalone
o faxq, which does queue management and runs standalone.
So, you'd have a 'hylafax' script that has two rc.conf switches 'hfaxd' and
'faxq' where the former would be optional.
Or, you'd have two scripts 'hfaxd' and 'faxq' where the former is optional
and depends on the latter (like e.g. Netatalk is set up).
>(By the way, /var/spool/hylafax/etc/config seems like a strange, non-pkg
>file location.)
Definitely.
hauke
--
/~\ The ASCII Ribbon Campaign
\ / No HTML/RTF in email
X No Word docs in email
/ \ Respect for open standards
From: grant@netbsd.org
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/18681: comms/hylafax 'faxd' started unconditionally
Date: Fri, 18 Oct 2002 09:08:00 +1000
On Thu, Oct 17, 2002 at 05:15:23PM +0200, Hauke Fath wrote:
> >Description:
> The hylafax 'hfaxd' can be operated standalone, or from
> inetd. The latter makes sense for a small site sending a few
> faxes a day.
>
> The '/etc/rc.d/hylafax' script starts 'hfaxd' unconditionally,
> blocking the inetd option.
>
> >How-To-Repeat:
> Install comms/hylafax, then set up a hfaxd entry in
> inetd.conf; wonder why it does not work.
if you don't want hfaxd to run in standalone mode, you can set
hfaxd=NO.
Does this not produce the desired result?
g.
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: grant@netbsd.org
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>, gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/18681: comms/hylafax 'faxd' started unconditionally
Date: Fri, 18 Oct 2002 10:53:04 +0200
At 9:08 Uhr +1000 18.10.2002, grant@netbsd.org wrote:
>if you don't want hfaxd to run in standalone mode, you can set
>hfaxd=NO.
>
>Does this not produce the desired result?
Yes. No.
'http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/comms/hylafax/files/hylafax.sh?rev=1
.4&content-type=text/x-cvsweb-markup'
The 'hylafax' script checks whether hfaxd is present/executable and whether
its config file is there, and then proceeds to start hfaxd. Unconditionally.
Splitting the script in one per daemon like for Netatalk would probably be
cleanest.
hauke
--
/~\ The ASCII Ribbon Campaign
\ / No HTML/RTF in email
X No Word docs in email
/ \ Respect for open standards
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.36 2007/11/24 03:27:39 kano Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.