If you have an issue with managing (start/stop/restart) supplementary services such as Sophos AV or Fulltext Search in the latest IceWarp build that could mainly happen to those who recently upgraded from RHEL/CentOS 6 to RHEL/CentOS 7, please follow the step below to resolve it.
HOW TO FIX IT
The recommended way of doing so is using the command below to remove a line.
visudo -f /etc/sudoers
After this, you should comment out Defaults requiretty line by adding a hash at the beginning of the line.
IceWarp manages supplementary services on CentOS via systemd and sudo. For legacy reasons, the following option was set by default in file /etc/sudoers.
You can also verify option presence via shell
root@my_server:~$ sudo -l
Matching Defaults entries for root on my_server:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, requiretty
With this option enabled, by IceWarp server performed start/stop of systemd services via systemctl command prefixed with sudo will fail. It is still possible to start supplementary services by the system administrator, but it is insufficient for the normal workload.
This option is, however, no longer set as default on RHEL/CentOS7 or newer OS (see https://bugzilla.redhat.com/show_bug.cgi?id=1020147), but OS installations upgraded from RHEL/CentOS6 may still contain it.
Sudo itself does allow to override settings via files inside folder /etc/sudoers.d/, and if possible, the IceWarp installer creates /etc/sudoers.d/icewarp_requiretty_override to address this by suppressing the requiretty option for users used by IceWarp services, however, due to RHEL 7 release specifics, override via /etc/sudoers.d/ does not seem to work correctly and is needed to adjust /etc/sudoers file.