Restart Zimbra Community Services CentOS 6

Restart Zimbra Community Services CentOS 6

There may be a time where restarting, stopping, or manually starting zimbra services is necessary. Here’s what you need to do:

Zimbra runs its own LDAP server, mailbox server (Jetty), MTA (Postfix), spam and virus filters and several helpers. They are not managed one by one with service; instead Zimbra ships zmcontrol, which starts and stops them in the right order, LDAP first.

Prerequisites

  • A Zimbra Collaboration (open source) server; the screenshots are from release 8.0.4 on CentOS 6.
  • Root or sudo access, to switch to the zimbra user.
  • A maintenance window: stopping Zimbra takes mail, webmail and calendars offline. Incoming mail is normally retried by the sending servers, but users notice the gap.

Step 1: become the zimbra user

Login as the Zimbra User, or su (these commands will not work as root)

su - zimbra
whoami
whoami returns zimbra at the zimbra@zimbradev prompt

The dash in su - zimbra matters: it loads the zimbra user’s environment, which puts /opt/zimbra/bin on the PATH. As root, zmcontrol stops with an error telling you it must be run as user zimbra.

Step 2: read the built-in help

Usually the Best Place to Look first is the MAN Page, here’s how to see the basics on the command:

zmcontrol -h
zmcontrol -h: Release 8.0.4 GA FOSS usage with restart, shutdown, start, startup, status and stop commands

zmcontrol -v prints the installed Zimbra version.

Step 3: check the status

To View The Status Of Zimbra Services, issue the following command:

zmcontrol status
zmcontrol status on zimbradev.zwiegnet.local: antispam, ldap, mailbox, mta and other services Running

Every service should show Running. A service listed as Stopped tells you where to look before restarting everything.

Step 4: stop Zimbra

to Stop Zimbra, issue the following command:

zmcontrol stop
zmcontrol stop: Stopping zmconfigd, stats, mta, mailbox, logger, ldap and other services... Done

all services are stopped now.

Step 5: start Zimbra

To Start Zimbra Services, Issue the Following Command as the Zimbra User:

zmcontrol start
zmcontrol start: Starting ldap, zmconfigd, logger, mailbox, mta, stats and other services... Done

To do both in one step, use zmcontrol restart. Afterwards run zmcontrol status again and wait until every service reports Running; the mailbox service can take a minute or two before webmail answers.

Restart from root or a single service

Zimbra also installs an init script, so as root on CentOS 6 service zimbra restart (or /etc/init.d/zimbra restart) does the same thing as zmcontrol and is what runs at boot. To restart just one component as the zimbra user there are per-service tools, for example zmmailboxdctl restart for the mailbox server and zmmtactl restart for the MTA.

Troubleshooting

  • A service will not start: look in /opt/zimbra/log/mailbox.log for the mailbox service and /var/log/zimbra.log for the rest.
  • zmcontrol status hangs or reports it cannot find enabled services: LDAP is usually down. Check that the server’s host name resolves to its own IP address and that the disk is not full, then start again.
  • Command not found: you used su zimbra without the dash, so the PATH is wrong. Use su - zimbra.

Newer Zimbra releases

zmcontrol works the same way on Zimbra 8.8, 9 and 10, including on RHEL, Rocky Linux and Oracle Linux 8 hosts. CentOS 6 itself is long out of support, so plan an upgrade to a supported OS and Zimbra release.

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

Related guides: Upgrade Zimbra Community Version CentOS 6 | Install Zimbra Community CentOS 6

Leave a Reply

Your email address will not be published. Required fields are marked *