Operating System - HP-UX
1834757 Members
2893 Online
110070 Solutions
New Discussion

Re: NIS not running - map mail.aliases

 
SOLVED
Go to solution
Jimmy Roux
Occasional Advisor

NIS not running - map mail.aliases

When I do:

cat |mailx -m -s ""

...the following message is return:

NIS map mail.aliases specified, but NIS not running: Socket operation on non-socket

I did not get this kind of message until my system crashed and have to replace the hard drive and rebuild my system.

What's causing this and how do I get rid of it without running NIS? Are there any alternatives besides e_mailing files using mailx?

Thank you.

Jimmy
Never ask the barber if you need a haircut.
6 REPLIES 6
Sajid_1
Honored Contributor
Solution

Re: NIS not running - map mail.aliases

hello,
This is a quick solution:

Add this line on /etc/nsswitch.conf file:

aliases: files
learn unix ..
S.K. Chan
Honored Contributor

Re: NIS not running - map mail.aliases

What you got is probably due to the entry "aliases" in /etc/nsswitch.conf which expect value searches from NIS and thus causing this error when NIS is not running on your machine. Take a look at the file /etc/nsswitch. If you see "NIS" defined in the line that has "aliases:" (regardless of it's order), delete the word "NIS" so that what's remaining looks like ..
aliases: files
That should fix your problem. You can use "elm" besides "mailx" .. for example ..
$ elm -s Test skchan@abc.com < myfile
Jimmy Roux
Occasional Advisor

Re: NIS not running - map mail.aliases

Cool! Thank you Sajid/S.K.

I was acutally looking at this file /etc/nsswitch.conf, and told myself that it is configured so what it is complaining about... So, deleting nis on that aliases line work. Are there any consequences to deleting nis if I want NIS to run on this server in the future?

Cheers,

Jimmy
Never ask the barber if you need a haircut.
Sajid_1
Honored Contributor

Re: NIS not running - map mail.aliases

hi again,

There is no problem for deleting the NIS entry from the file now. If the entry is there, then it searches for NIS maps and will error out as it is not configured on your server.

In future, if you are setting up NIS on this system and if you want to look at the NIS tables/maps, then you can add NIS after the 'files' entry or before that, depends up on your wish to assign priority.

HTH
learn unix ..
S.K. Chan
Honored Contributor

Re: NIS not running - map mail.aliases

The answer is it depends. If you want NIS to manage your mail.aliases file and on the client side you want the search to include that of the NIS map file then adding the "NIS" entry in /etc/nsswitch.conf will achieve that. It also depends on your preferred search order (local file vs NIS file).
Jimmy Roux
Occasional Advisor

Re: NIS not running - map mail.aliases

Thanks again guys!

Cheers,

Jimmy
Never ask the barber if you need a haircut.