sendmail kills startup?

Place to discuss Fedora and/or Red Hat
Post Reply
ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

sendmail kills startup?

Post by ZiaTioN » Mon Dec 22, 2003 11:12 pm

Just a quick question. Ever since I ran RH 8.0 when I startup the Linux box or restart and the system goes through all it's startup checks where it lists [OK] next to everything, sendmail and sm-client hang there for about 5 or 6 minutes a piece. It never did this in 7.3 but it does in 8.0 and 9.0. I recently re-installed 9.0 on my system and for the first few weeks I did not have this problem. Just tonight it started again and it is really starting to annoy me.

I am to the point where I am thinking about removing it from the list of things to start on bootup but do not think I should have to do this. That is just a work around and does not tell me anything about the problem itself. I guess my question is this. Does anyone know why this would be happening? Is there a bootup log somewhere in RH9 that I can view to check for errors during bootup?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Dec 23, 2003 8:12 am

Yes there are logs. You can view then directly in /var/log directory. The info you would be interested in will likely be in /var/log/messages or /var/log/maillog. There is also a graphical utility to view/search the logs on the Red Hat menu. If you are not using sendmail you should shut it down anyhow. After it boots up try something like:

# grep sendmail /var/log/messages | tail -20

Sounds like a hostname or DNS or some other name resolution problem. Do you actually use Sendmail? If you don't why have it running? It's taking up resources for no reason:

# chkconfig sendmail off

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Tue Dec 23, 2003 10:15 am

Cool, yeah I had already found the graphical log viewer just by poking around in the menue. It was a dns thing. The reason why it starting happening again just recently is because I edited by syslog to permantly change my hostname on the system so I originally added the new hostname to be resolved to 127.0.0.1 just like localhost and localhost.localdomain was.

This is when it worked fine. The other day I added a new line which consisted of my network address (192.168.0.4) and then moved the hostname down to that line to be resolved to that IP address. This is when the problems began. The sendmail tries to start before this address is ever issued by my router and before the ethernet interface even comes up so of course there is a problem. I just copied the hostname to resolve to both addresses and it fixed it right up. Anyway now I will kill it on startup seeing how I do not use it. I just wanted to figure out what the deal was before I did that.

Thanks for the reply.

Oh and another thing I think I am having an issue with my $PATH for some reason. Last night I noticed that when using "ifconfig" that I got the returned error saying that command did not exist. Well I went and looked in sbin and there it was so I issued the full path and it worked. I looked at my $PATH variable in my root .bash_profile and sbin was not in my path. I tried to add it but it never took so I just created an alis for that command and pointed it to the full path. Now I just tried to use "chkconfig" and got the same error.
[root@thegnuage ziation]# chkconfig sendmail off
bash: chkconfig: command not found
How can I add sbin and other needed directories to my path because the way I did it was obviously worng (I think).

Here is what my path variable looks like now.
PATH=$PATH:$HOME/bin

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Dec 23, 2003 11:45 am

You shouldn't have to mess with anything in root's PATH. I assume you do not log in directly as root (as you shouldn't) and use the "su" command. If you use the "su" command to become root you also need to add the "-" parameter in order to get root's environment (including root's PATH) like so:

$ su -

I never mess with root's environment at all in any Linux or UNIX installation. Doing so usually results in less security.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Tue Dec 23, 2003 1:46 pm

Yes that was exactly it. I had never heard of using the dash (-) to accomplish this. I just thought that even when using su to switch users that the user you switched to would have his/her environment variables available to him/her by default.

Do you see any reason why creating a global alias for all user (except root) of "alias su=su -" would be a security issue so I do not have to worry about this anymore?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Dec 23, 2003 2:25 pm

I wouldn't. "su -" is standard on all UNIX and UNIX Like operating systems I have ever used (and that is a lot of them). It's basically the difference between just starting a shell and starting a "login shell":

http://voidmain.is-a-geek.net/man/?para ... u&mode=man

There are times when I prefer to just do an "su" and not load root's environment. As long as you know the difference you should use the syntax most appropriate for what you want to accomplish. Now, since I also prefer to have "/sbin" and "/usr/sbin" in my personal path they also are part of the PATH whether I do an "su" or an "su -". The PATH setting in my personal ~/.bash_profile looks like this:

Code: Select all

PATH=$PATH:/sbin:/usr/sbin:$HOME/bin
export PATH

Post Reply