Missing FreeBSD map file

Software

Today I learned FreeBSD can’t lodge email reports for root if aliases.db was never created, either in bsdinstall or your jail.

Long story short, I was seeing this after sudo-ing into a new instance:

[date] [hostname] sudo: [user]: user NOT in sudoers ; [..]

Heh, my bad. But then this appeared:

SYSERR(root): hash map "Alias0": missing map file /etc/mail/aliases.db
No such file or directory

Huh. So just to try, I “created” the file thusly:

# touch /etc/mail/aliases.db

Needless to say, that didn’t work! The solution, ironically from some ancient Red Hat docs:

# makemap hash /etc/mail/aliases.db < /etc/mail/aliases

This command must be run after creating an /etc/mail/aliases file. You also need to run it if you make any changes.

Happy long weekend!

Author bio and support

Me!

Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.