Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34776 - location for tcprules: /etc/tcprules.d/tcp.${SERVICE}.cdb
Summary: location for tcprules: /etc/tcprules.d/tcp.${SERVICE}.cdb
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-30 13:58 UTC by Khayyam
Modified: 2006-06-14 18:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/qmail/bin/qmail-rulesupdate (qmail-rulesupdate,216 bytes, text/plain)
2006-01-06 09:42 UTC, Bel Zébute
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khayyam 2003-11-30 13:58:44 UTC
As per your request in /var/qmail/supervise/qmail-*/run re modifications.

As we now have six tcprules files (that is, exculding rules for publicfile,
djbdns etc, if they also happen to be installed) in etc should these not be
given their own directory and modify run to reflect this .. /etc/tcprules.d
would seem the logical choice ..
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 14:40:39 UTC
ok, i've got a mod to move the qmail files to /etc/tcprules.d/tcp.qmail-$SERVICE, I'm testing it out for inclusion in -r14
Comment 2 Khayyam 2003-11-30 14:57:56 UTC
humm .. typo? .. that would be /etc/tcprules.d/tcp.$SERVICE{.cdb} no? 
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 15:03:16 UTC
nope, not a typo at all.
/etc/tcp.${SERVICE}{,.cdb} moves to /etc/tcprules.d/tcp.qmail-${SERVICE}{,.cdb}

I'm explictly adding the string 'qmail-' after 'tcp.' but before the service so that things can be easier identified when there are more tcprules files in place.

additionally, the location is now a variable in the conf-* files.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 15:11:33 UTC
my primary reason for doing that is for people that want weird setups such as multiple mail servers on a single machine (quite doable actually).

As an example for it, my friend has both qmail and qmail-mysql on his server.
qmail-smtpd listens on his external ip only, and after doing some processing, re-injects the message to his qmail-mysql, which does all the local deliveries.
his internal network interface also feeds to qmail-mysql.
Comment 5 Khayyam 2003-11-30 15:34:04 UTC
Ok .. but that sounds like quite a non-standard setup, one that could be
fixed by the user in question by simply editing run, which s/he would have
to do anyway.

the following is what is was writting before the mid-air collision:

It's not like smtp, qmqp etc are not unique enough.Besides will we then see tcp.publicfile-ftp.cdb, or tcp.djbdns-dnscache.cdb?

Though I have seen some other methods for doing this, like under
/service/$SERVICE/ tcprules.cdb, tcp.$SERVICE.cdb does seem fairly standard.

Comment 6 Khayyam 2003-11-30 15:36:58 UTC
OK .. after re-reading your message i see the reason (multiple qmails) ..
please ignore
Comment 7 Khayyam 2003-11-30 15:51:17 UTC
but wait .. qmail and qmail-mysql do not co-exist .. so this would be a fairly
non-standard install. Given that, it is not so much additonal work on thier
part to add a /etc/tcprules.d/tcp.smtp-mysql.cbd and have thier */qmail-mysql/run
call it ..
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 16:37:54 UTC
They can co-exist without too much work.

For an example you can build right away out of existing packages, look at mailfront+qmail. (My friend considered this originally, as mailfront is designed for this purpose, but it doesn't support SSL, which he needed in his external frontend).
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-03-12 23:44:41 UTC
fixed the summary line.
Comment 10 Bel Zébute 2006-01-06 09:42:07 UTC
Created attachment 76359 [details]
/var/qmail/bin/qmail-rulesupdate

Even though it'sold, this bug report seems to be the most proper place for this.

I'm having difficulties figuring out what was the intentions of those who implemented /etc/tcprules.d.

There is obviously a Makefile in the folder, but it does not work (typing make from the folder).  Reading it, I guess it is called by some script which will define the CDBS variable (Yes, I'm clueless with Makefile's).  So, I guess I'm asking a question here.

My true reason for posting concerns what is written at the begining of those rules files:
#------------------------------------------------------
# To update the database after changing this file, run:
# /var/qmail/bin/qmail-rulesupdate
#------------------------------------------------------

Well, that script does not work.  It tries to create a .cdb out of the Makefile file (which hangs forever), and the loop in the script is plain broken.  I'm puzzled as to howcome it is there or how it supposed to be used.  I guess I'm asking a question here too.

To summarize, I have attached a working script.  If it's no good, toss it.
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-06-14 18:11:55 UTC
sorry about the long delay on this. It just slipped by that I have never commited the final part of this: Makefile.qmail.

It is now in qmail-1.03-r16, just emerge it again, and you'll see it.
It does the same thing as the qmail-rulesupdate script that Bel uploaded here, but better, as it only rebuilds if there was a change.

just 'cd /etc/tcprules.d/ && make'
or 'make qmail' if you only want to rebuild the qmail cdb files.