Koozali.org: home of the SME Server

How to disable some services?

NicolBolas

How to disable some services?
« on: March 06, 2006, 08:21:20 AM »
Hi !

I'm deploying a pair of SME 7 servers for my company. Their role will be to host websites, mailboxes and offer VPN access, and optionally to let LDAP acessible from the internal network.

I have public IPs for both SME, and they have a single adress on my local network. I already have a DNS/DHCP server on the LAN.

I need the following services to be avaible :

On the WAN side :
- http
- smtp (with authentification)
- imaps
- pptp
- webmail (https only)

On the LAN side :
- http
- smtp
- imaps
- ftp (for iBays only)
- ldap
- webmail

I want to disable the folowing :

- http proxy
- smtp proxy
- samba
- NAT (already have a router on another connexion for surfing from the LAN)
- DHCP (already disabled)
- internal DNS (even external if not needed as the domains are resolved by a public DNS on internet)
- atalkd (never used it anyway)
- lpd (no printer attached, will never be)
- smartd (running in vmware, no smart avaible)
... (i may have missed some, sme provides too much ;)

The question is : how to properly disable these services without compromising SME' stability?

Thanks a lot for any help provided ;)

edit:
Before anyone asks, I use 2 servers because I have to dissociate two sets of domains for 2 different legal entities, thus avoiding me to use the same IP an virtual machine for both servers. As I make an extensive use of virtualisation for my servers, it won't cost more to have 2  virtual machines instead of just one...

edit2:
I have an issue while trying to install vmware-tools. It needs to unload network card driver module, and rmmod locks on it because eth1 (internal) is in use. How to free it? I thought I could boot in rescue/single user mode but there's no relevant option in grub menu. How to let it unload the module?

Offline sonoracomm

  • *
  • 208
  • +0/-0
    • http://www.sonoracomm.com
How to disable some services?
« Reply #1 on: February 04, 2007, 08:44:29 PM »
On the VMware Tools front:
http://www.sonoracomm.com/index.php?option=com_content&task=view&id=54#SME7guest

As for the services, I have used 'chkconfig servicename off' and 'chkconfig --list' for this purpose, but I, too, would appreciate guidance by experts.

Here is more info on the subject:
http://www.sonoracomm.com/index.php?option=com_content&task=view&id=114

G

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
How to disable some services?
« Reply #2 on: February 04, 2007, 10:11:01 PM »
Quote from: "sonoracomm"
As for the services, I have used 'chkconfig servicename off' and 'chkconfig --list' for this purpose, but I, too, would appreciate guidance by experts.
The status of services is set per the configuration database:
Code: [Select]
config show mysqldwill show you the status of the mysql daemon. It also has a status entry, you can set this to disabled
Code: [Select]
config setprop mysqld status disabledAfter a reboot the service will not start when you have set it to be disabled. However some services depend on each other, for instance webmail depends on the mysqld service as it stores its data in mysql tables.

(Edit: corrected syntax)
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to disable some services?
« Reply #3 on: February 04, 2007, 10:13:47 PM »
Quote from: "NicolBolas"
I have an issue while trying to install vmware-tools. It needs to unload network card driver module, and rmmod locks on it because eth1 (internal) is in use. How to free it? I thought I could boot in rescue/single user mode but there's no relevant option in grub menu. How to let it unload the module?
I always followed the instructions from the vmware-tools script after some hack I found in the forums: http://forums.contribs.org/index.php?topic=32138.0
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
How to disable some services?
« Reply #4 on: February 04, 2007, 11:48:31 PM »
Quote from: "sonoracomm"


As for the services, I have used 'chkconfig servicename off' and 'chkconfig --list' for this purpose, but I, too, would appreciate guidance by experts.



http://forums.contribs.org/index.php?topic=33667.msg144157#msg144157
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
How to disable some services?
« Reply #5 on: February 04, 2007, 11:50:43 PM »
Quote from: "cactus"
The status of services is set per the configuration database:



Code: [Select]
config show |grep "service\|status"
Regards,
William

IF I give advise.. It's only if it was me....

Offline Boris

  • *
  • 783
  • +0/-0
How to disable some services?
« Reply #6 on: February 04, 2007, 11:52:12 PM »
Quote from: "cactus"
Code: [Select]
config set mysqld status disabled

Shouldn't it be config setprop ...... instead of "set"?
...

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: How to disable some services?
« Reply #7 on: February 05, 2007, 12:04:12 AM »
Quote from: "NicolBolas"


edit2:
I have an issue while trying to install vmware-tools. It needs to unload network card driver module, and rmmod locks on it because eth1 (internal) is in use. How to free it? I thought I could boot in rescue/single user mode but there's no relevant option in grub menu. How to let it unload the module?


http://no.longer.valid/phpwiki/index.php/How-To%20install%20VMware-Tools%20on%20a%20SME%207.0%20Virtual%20Machine
Regards,
William

IF I give advise.. It's only if it was me....

Offline sonoracomm

  • *
  • 208
  • +0/-0
    • http://www.sonoracomm.com
How to disable some services?
« Reply #8 on: February 05, 2007, 12:12:33 AM »
I am interested in what services, or groups of services, are 'safe' to turn off without causing problems with SME 7.

I can always experiment, but if someone already knows...

TIA,

G

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
How to disable some services?
« Reply #9 on: February 05, 2007, 07:23:11 AM »
Quote from: "Boris"
Quote from: "cactus"
Code: [Select]
config set mysqld status disabled

Shouldn't it be config setprop ...... instead of "set"?
You are absolutely right... the correct command to disable a service, for example mysqld is:
Code: [Select]
config setprop mysqld status disabled
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
How to disable some services?
« Reply #10 on: February 05, 2007, 09:59:25 PM »
Another way to switch services on and off is to use the sme7admin contrib. You can then do it with the server-manager page. Works great.

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
How to disable some services?
« Reply #11 on: February 05, 2007, 10:15:09 PM »
Quote from: "Gert"
Another way to switch services on and off is to use the sme7admin contrib. You can then do it with the server-manager page. Works great.

Untill you reconfigure and reboot your server.
Cactus is correct.
"It should just work" if it doesn't report it. Thanks!