Disable unused services

Hi everyone, first congratulations on a really good project. I sent a suggestion on github and thank you

I did a standard installation but at the moment I won’t use some services. What way to disable them so that I can use them again in the future?

Ubuntu 22.04 LTS arm

bind9
clamav-daemon
dovecot
exim4
spamassassin

Thanks Maison

Hi @maisondasilva,

Hestia doesn’t include a complete process to disable those services but you can do this as root to disable them:

Note: Before doing any change, backup at least the file /usr/local/hestia/conf/hestia.conf

Warning: as this is not a supported method by Hestia, use at your own risk.

1.- To disable the services:

bind9

v-change-sys-config-value DNS_SYSTEM ""
systemctl disable named
systemctl stop named

clamav-daemon

v-change-sys-config-value ANTIVIRUS_SYSTEM ""
systemctl disable clamav-daemon
systemctl stop clamav-daemon

dovecot

v-change-sys-config-value IMAP_SYSTEM ""
systemctl disable dovecot
systemctl stop dovecot

exim4

v-change-sys-config-value MAIL_SYSTEM ""
systemctl disable exim4
systemctl stop exim4

spamassassin For Debian 12

v-change-sys-config-value ANTISPAM_SYSTEM ""
systemctl enable spamassassin
systemctl start spamassassin

spamassassin For Debian 10, 11 or Ubuntu 20.04, 22.04

v-change-sys-config-value ANTISPAM_SYSTEM ""
systemctl disable spamassassin
systemctl stop spamassassin

2.- To enable the services again:

bind9

systemctl enable named
systemctl start named
v-change-sys-config-value DNS_SYSTEM "bind9"

clamav-daemon

systemctl enable clamav-daemon
systemctl start clamav-daemon
v-change-sys-config-value ANTIVIRUS_SYSTEM "clamav-daemon"

dovecot

systemctl enable dovecot
systemctl start dovecot
v-change-sys-config-value IMAP_SYSTEM "dovecot"

exim4

systemctl enable exim4
systemctl start exim4
v-change-sys-config-value MAIL_SYSTEM "exim4"

spamassassin For Debian 12

systemctl enable spamd
systemctl start spamd
v-change-sys-config-value ANTISPAM_SYSTEM "spamd"

spamassassin For Debian 10, 11 or Ubuntu 20.04, 22.04

systemctl enable spamassassin
systemctl start spamassassin
v-change-sys-config-value ANTISPAM_SYSTEM "spamassassin"

Disclaimer: some services could require modifying its conf file. For example, if you want to disable clamav and spamassassin but not exim4.

Edit: I used bind9 as service but it is actually named so I’ve fixed it.

Cheers,
sahsanu

2 Likes

Thanks for the answer, could I just use systemctl disable on services, without removing the information?

root@server:~# systemctl disable spamd
Failed to disable unit: Unit file spamd.service does not exist.
root@server:~# systemctl stop spamd
Failed to stop spamd.service: Unit spamd.service not loaded.
root@server:~#

For disable spamassassin correct is?

systemctl disable spamassassin
systemctl stop spamassassin
root@server:~# systemctl disable spamassassin
Synchronizing state of spamassassin.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable spamassassin
Removed /etc/systemd/system/multi-user.target.wants/spamassassin.service.
root@server:~# systemctl stop spamassassin

Thank you Maison

No, because Hestia will think those services are available.

Yes. I use Debian and there the service is spamd.

Ok, thanks for the update, if possible add the commands for Ubuntu to your post and leave the Debian command below for other people!

At this point, if I wish, can I remove the packages with remove and purge?

Thanks
Maison

Done

If you plan to enable again those services I wouldn’t remove them. If you are not going to use them anymore, yes, you can remove and purge them.

1 Like

Should be spamd

I used spamassassin only to know about the service that is being changed, systemctl and v- command use the right name spamd

1 Like

I installed a new test cloud and selected the minimum possible packages, however I see the error sh: 1: /usr/sbin/sendmail: not found at the end of the installation, which service do I need to have active for sendmail to be installed? I installed the packages below

I’m testing on a cloud at Oracle Free, what would be the best solution for sending emails from Wordpress?

    - NGINX Web/Proxy Server
    - PHP-FPM Application Server

    - MariaDB Database Server
    - Vsftpd FTP Server
    - Firewall (iptables) + Fail2Ban Access Monitor

Exim (mail server) provides a wrapper for sendmail so if you want to use it and send emails from Wordpress I would install Hestia with Exim.

@sahsanu In my case, I’m using those Oracle test clouds, it seems that port 25 is blocked but port 587 is not blocked, what would you suggest to me to be able to send automatic emails from Wordpress? Example when someone comments or receives a reply to the comment

Thanks
Maison

I would use Exim and will add a SMTP Relay, there are some out there that allow to send a limit of mails for free (for example https://www.brevo.com).

If you would use this route, take a look to these links:

Email and mail server | Hestia Control Panel

Email and mail server | Hestia Control Panel

1 Like

@sahsanu

Perfect, I’ll do that, my question is in addition to Exim installed, I need to install Dovecot or just Exim and it should work for me!

So basically can I install Ngnix, MariaDB, PHP, HestiaCP and Exim?

PS, I’m not going to use an email account, I’m just going to use email for Wordpress Notify people!

Thanks
Maison

Then instead of Exim you could install something like nullmailer or ssmtp (I’ve never used any of them so I can’t help)

@sahsanu I understand, my question is do I need Dovecot or does installing just Exim solve my problem?

If you won’t use Hestia to manage mails, use the mail server you want. If you want to manage it using Hestia, install Exim+Dovecot.

No only Exim is enough…

It it my self on some servers it works fine …

1 Like

@eris Could you tell me how you use Oracle Free?

@sahsanu
If I use Sendinblue, for example, can I configure it directly in Wordpress or do I need the server to have Exim/sendmail installed?

I have this doubt because of the error sh: 1: /usr/sbin/sendmail: not found

You need to make some changes and it will work fine if you want to use Oracle cloud smtp

If you want to use Sendinblue you can do it via a Wordpress plugin or setup exim …

1 Like

OK, Thank you in this case so I will just install Exim, that is enough to use the two solutions above right?

@eris @sahsanu A personal question, do you usually use ClamAv and SPamassing?