LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-23-2015, 02:40 PM   #1
mike2010
Member
 
Registered: Jan 2009
Posts: 132

Rep: Reputation: 15
Disable Postfix completely ?


I'm having an issue trying to keep Postfix grounded completely.

I'll run

postfix stop (from root)

and it'll successfully stop without any errors. But only for like 5 minutes...then it starts again on it's own. Seems like the Plesk install on it might be the culprit, and making it restart.

I read a site just now that a guy uninstalled postfix completely, and it caused his plesk install to fail. So I guess I don't want to uninstall it. Just to stop it completely.

I don't use email on the server.

I'm running a Linux/Unix - Centos .

my postfix starts at /etc/rc.d/init.d/postfix

config file is at /etc/postfix/master.cf and main.cf are both located there.

I have root access to whole server.

any help is much appreciated.
 
Old 03-23-2015, 02:57 PM   #2
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
I can't speak to Plesk, but to stop the service from running on startup you can do:

Code:
chkconfig postfix off
 
Old 03-23-2015, 02:58 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Like you said your plesk install keeps starting postfix and if that is the case then you have got two options:

1. Misconfigure postfix configuration file so that plesk is not able to start it at all. However, if plesk depends on or checks the exit status whether it was able to start postfix successfully or not then you have to go with option 2.

2. Create a watch dog script which will check postfix and put it in cron to run every minute (you can configure the script to check every 30 seconds with a little tweak that is adding sleep command). Example script to put it in cron:

Code:
#!/bin/bash
#Script to check postfix
service postfix status
    if [ $? -eq 0 ]
    then
    {
         service postfix stop
    }
    else
    {
         echo "Service postfix already stopped" > /dev/null
    fi
 
Old 03-23-2015, 03:06 PM   #4
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
You could also use iptables to block traffic (incoming and outgoing) on the SMTP ports so that postfix is effectively off.
 
Old 03-23-2015, 03:21 PM   #5
mike2010
Member
 
Registered: Jan 2009
Posts: 132

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by YankeePride13 View Post
You could also use iptables to block traffic (incoming and outgoing) on the SMTP ports so that postfix is effectively off.
Yankee, I tried this first. But all the postfix processes still ran.

Quote:
chkconfig postfix off
This command seemed to run without a problem. Rebooting server now to see what's up.

To turn back on, i'm guessing
Quote:
chkconfig postfix on
and then another reboot ?

^ the rest of you guys, I appreciate the advice as well.
 
Old 03-23-2015, 03:27 PM   #6
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
If the Plesk application launches the Postfix daemon, the chkconfig line won't stop that.

IPtables rules wouldn't stop the Postfix daemon from running, but it would prevent e-mail from coming in and going out. That's not enough in this situation (not being snarky, just asking)?
 
Old 03-23-2015, 03:28 PM   #7
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
Also yes, to allow the service to be booted on start up you'd do:

Code:
chkconfig postfix on
 
Old 03-23-2015, 03:36 PM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
chkconfig postfix off or chkconfig postfix on here is irrelevant the reason being postfix is triggered by plesk as you said. So if I will keep it off during startup eventually it will be turned on by plesk.
 
Old 03-23-2015, 03:36 PM   #9
mike2010
Member
 
Registered: Jan 2009
Posts: 132

Original Poster
Rep: Reputation: 15
after running chkconfig postfix off and a reboot.

I see a few Postfix processes still running like

Postfix Cleanup

Postfix - PSA-PC-Remote (plesk related crap)

Postfix Smtp

Postfix Pickup

but their far and few between....like once every 3 minutes, and their not taking up any CPU. Is it normal for them to still show up on Top even though it's suppose to be disabled? It's taking up like no CPU, so that's good.

friggin process seems unstoppable, unless it's uninstalled.

blocking the firewall ports, might be why it's taking up no cpu now.

Last edited by mike2010; 03-23-2015 at 03:38 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to *completely* disable all power saving features? Ook Slackware 5 01-04-2013 03:58 AM
Anyone know to completely disable commflag with mythtv? darkstarbyte Linux - Software 0 12-10-2012 02:44 AM
Enable NumLock and then disable the button completely TL_CLD Slackware 4 01-10-2010 10:24 AM
Completely disable SWAP Syrrace Linux - Security 8 11-27-2008 07:23 AM
How to disable firewall completely zyzyis Linux - Newbie 2 09-21-2004 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration