cancel
Showing results for 
Search instead for 
Did you mean: 

Sendmail

SOLVED
Go to solution
manny_9
Frequent Advisor

Sendmail

Hi,

I was asked to stop sendmail (redhat 7.2)

I tried sendmail stop , wouldn't work

I ended up with kill -9 with the pid.

How do I restart without rebooting ????


Thanks in advanve!
15 REPLIES
Stuart Browne
Honored Contributor
Solution

Re: Sendmail

If you have successfully stopped all sendmail processes (ps -ef | grep sendmail), then the command:

service sendmail start

should start it again. To stop sendmail, you should have just used:

service sendmail stop

One long-haired git at your service...
Alex Ferreira
Frequent Advisor

Re: Sendmail

Hey friend,

/etc/init.d/sendmail start

should do the job for you...

Procedure for stopping and starting sendmail is no different to any other process..

Tip: If your machine seems to hang for a few minutes while loading sendmail( after the starting sendmail: message is printed), the machine's hostname cannot be resolved. To fix this, add the machines I.P address and hostname to the /etc/hosts file. This behaviour can occur as the X server attempts to start.

Hopes this helps.

Alex
Steven E. Protter
Exalted Contributor

Re: Sendmail

service sendmail restart

Will restart with one command.

As noted earlier

service sendmail stop to stop it.

The service command works on all Linux daemons.

If you want to stop DNS,

service named stop

Just wanted to make sure you understood that service is an all encompassing, useful command. So much so, that I ported it to HP-UX.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: Sendmail

hehe ;) go SEP.. Welcome back by the way ;)

Sometimes it's just amazing how such a simple idea makes things so much easier..

The 'service' command (an 11 line script originally) was implemented way-back in RH6.0 (or possibly .1, can't recall), but it was broken at that point. Didn't get fixed properly until 7.0.

go figure.. ;)
One long-haired git at your service...
Alex Ferreira
Frequent Advisor

Re: Sendmail

Hey SEP,

what do you mean by porting it to HP-UX? I tried doing a man on service and I got a smack in the mouth by the console saying

"No manual entry for service."

Alex
manny_9
Frequent Advisor

Re: Sendmail

Thanks guys!! Will try tomorrow!!!!!!
Stuart Browne
Honored Contributor

Re: Sendmail

Alex,

Most Unicies have a central directory structure where the start/stop routines live, which are usually symbolically linked to the /etc/rc#.d/ structures for the start up/shut down routnies.

In RedHat, they used to be /etc/rc.d/init.d, but have moevd to /etc/init.d (although they are sym-linked together), and for SCO Open Server 5.0.5+ and Solaris 8 (not sure about other versions) it's the same (/etc/init.d).

Using the same method that /usr/sbin/service uses in RedHat (actually you could probably copy it without any issue) you can easily port the function to any other unix.
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: Sendmail

In this thread, my last or second to last post includes a script called service

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf0fc5dc05a7ad711abdc0090277a778c,00.html

It is not an official HP script, just makes it easier for my brain to switch back and forth from Linux to HP and back.

You copy it to the path, make sure its owned by root and that nobody else can execute it and the service command is on HP-UX.

It checks that the service in question is a valid script in /sbin/init.d/

Let me know if you need any help with it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alex Ferreira
Frequent Advisor

Re: Sendmail

SEP & S.B,

you guys rock... Thank you...

This forum rocks....

Alex...
manny_9
Frequent Advisor

Re: Sendmail

One more question!

I just remebered. When I sent kill -9 sendmail. There was one service that was associated with sendmail that I left alone , i wasn't sure what it was.I saw it when I did "sendmail status". It was something like (pid) can't remember specifically i am at home. Should I kill that service before restart???

The reason sendmail was shut down, was internal users (win98) had SOBIG-f in thier outlook express. The redhat server did not detect the worm???Everything up to date! Can't figure out the worms entry point.Could it have been internal.

Thanks
Stuart Browne
Honored Contributor

Re: Sendmail

If the 'queue runner' was also running (or sm-client), then yes, you should kill that one as well.

Sendmail does not do any Virus detection, unless you have explicitly set that sort of thing up.
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: Sendmail

Fred,

The worms entry point was probably not internal.

I will say this, sendmail will accept and tranmit mail, including virus attachments without any effect on the Linux or HP-UX system.

When nailing sendmail, there could be multiple active processes. To get sendmail with kill commands, this little script(attached) will do the trick.

In your scenario, you should first to this:

service sendmail stop

gkill sendmail (or any possible client processes)

The utility will list the processes set to die and then make them die with good reliability.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Sendmail

Sorry, here is the post with attachment as promised.

Fred,

The worms entry point was probably not internal.

I will say this, sendmail will accept and tranmit mail, including virus attachments without any effect on the Linux or HP-UX system.

When nailing sendmail, there could be multiple active processes. To get sendmail with kill commands, this little script(attached) will do the trick.

In your scenario, you should first to this:

service sendmail stop

gkill sendmail (or any possible client processes)

The utility will list the processes set to die and then make them die with good reliability.



SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: Sendmail

For confusion's sake, the linux version of 'killall' will do the same thing.

killall -9 sendmail

will find *ANY* sendmail process and send it a KILL (9) signal.

Beware using 'killall' on different platforms however. Some platforms version of 'killall' does just that, kills all processes..
One long-haired git at your service...
manny_9
Frequent Advisor

Re: Sendmail

Hey!!!!

I just wanted to say Thanks again to everyone!!!