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

newaliases - is restart required

21 views
Skip to first unread message

tlhackque

unread,
Jan 30, 2017, 7:56:36 PM1/30/17
to
If I run newaliases, what is required for Sendmail to notice the changes?

The standard ("safe") advice seems to be "restart sendmail".

I've seen references to killing it with HUP, and also empirically seen that sendmail seems to pickup changes without doing anything.

Obviously, it's less painful if it's not necessary to restart sendmail. (On a busy system, restarting may abort incoming mail (causing delay), and may also involve restarting multiple processes. A rather heavy price to pay for j.random.user adding a throw-away alias...)

Is there a definitive answer?

Environment:

newaliases writes its statistics to the mail log file.

sendmail -d0.1
Version 8.14.9
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT

file aliases.db
mailman-aliases.db: Berkeley DB (Hash, version 8, native byte-order)

Claus Aßmann

unread,
Jan 30, 2017, 8:45:49 PM1/30/17
to
tlhackque wrote:
> If I run newaliases, what is required for Sendmail to notice the changes?

Nothing (give it a try...) as long as it is a "database-oriented
map":
The program makemap(8) can be used to build any
of the three database-oriented maps. ...

The sendmail daemon does not have to be restarted to
read the new maps as long as you change them in place;
file locking is used so that the maps won't be read
while they are being updated.


--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.

timoth...@gmail.com

unread,
Jan 30, 2017, 10:23:46 PM1/30/17
to
On Monday, January 30, 2017 at 8:45:49 PM UTC-5, Claus Aßmann wrote:
> tlhackque wrote:
> > If I run newaliases, what is required for Sendmail to notice the changes?
>
> Nothing (give it a try...) as long as it is a "database-oriented
> map":
> The program makemap(8) can be used to build any
> of the three database-oriented maps. ...
>
Thanks. I'm cautious about "proof by experiment", as "works sometimes" can be an issue.

makemap isn't used for aliases (aliases uses a "special marker @:@" in the database according to the docs (ops guide 2.6.2). Which mentions "deals with crashes while creating the DB", and "deals with updates seen when another process updates the DB without suitable locking". But it doesn't say that newaliases is guaranteed to "change the maps in place" or that Sendmail doesn't cache aliases.

FWIW, lsof doesn't show aliases.db open...
0 new messages