So I got this email from my server this morning after update of ubuntu to 24.04 and Carbonio to newest.
Cron <zextras@mail> . /opt/zextras/.bashrc; /opt/zextras/libexec/zmsaupdate
zmsaupdate: Amavisd restart failed!
So I checked zmsaupdate
and in line 49
we have this
my $restart="/opt/zextras/bin/zmamavisdctl restart norewrite >/dev/null 2>&1";
I changed it to, since it gives "Services are now handled by systemd.
Enabled systemd targets:
- carbonio-directory-server.target
- carbonio-appserver.target
- carbonio-proxy.target
- carbonio-mta.target
Please check the documentation for further details.
Exiting."
my $restart="/bin/systemctl restart carbonio-mta.target >/dev/null 2>&1";
This does also not work since Zextra cannot run
/bin/systemctl restart carbonio-mta.target
it need escilation...
I think someone forgot this in the upgrade.
Thanks for pointing this to us. I tried to check it on my test setup (CE 25.6.0 - Ubuntu 24.04), but could not generate the error you mentioned (zmsaupdate: Amavisd restart failed!).
zextras@mail:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04.2 LTS Release: 24.04 Codename: noble zextras@mail:~$ zextras@mail:~$ /opt/zextras/libexec/zmsaupdate zextras@mail:~$ zextras@mail:~$ /bin/bash -c '/opt/zextras/.bashrc; /opt/zextras/libexec/zmsaupdate' zextras@mail:~$ zextras@mail:~$ /opt/zextras/bin/zmamavisdctl restart norewrite Services are now handled by systemd. Enabled systemd targets: - carbonio-directory-server.target - carbonio-appserver.target - carbonio-proxy.target - carbonio-mta.target Please check the documentation for further details. Exiting.
But you have correctly pointed that zmamavisdctl restart is handled by systemd. Therefore, what is the impact of this parameter (on line 49 of zmsaupdate) within the script and on the whole operation.
I will share this with our devs.
Regards,
Thanks for pointing this to us. I tried to check it on my test setup (CE 25.6.0 - Ubuntu 24.04), but could not generate the error you mentioned (zmsaupdate: Amavisd restart failed!).
zextras@mail:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04.2 LTS Release: 24.04 Codename: noble zextras@mail:~$ zextras@mail:~$ /opt/zextras/libexec/zmsaupdate zextras@mail:~$ zextras@mail:~$ /bin/bash -c '/opt/zextras/.bashrc; /opt/zextras/libexec/zmsaupdate' zextras@mail:~$ zextras@mail:~$ /opt/zextras/bin/zmamavisdctl restart norewrite Services are now handled by systemd. Enabled systemd targets: - carbonio-directory-server.target - carbonio-appserver.target - carbonio-proxy.target - carbonio-mta.target Please check the documentation for further details. Exiting.But you have correctly pointed that zmamavisdctl restart is handled by systemd. Therefore, what is the impact of this parameter (on line 49 of zmsaupdate) within the script and on the whole operation.
I will share this with our devs.
Regards,
Also using carbonio version 25.6.1 (latest so far) on ubuntu 24.04
"/opt/zextras/bin/zmamavisdctl restart norewrite >/dev/null 2>&1" is a command built to work on older code of carbonio (zimbra) that didn't use systemd. Now that Carbonio uses systemd, the script doesn't reboot the service amavisd, that command only informs that it should be done via systemctl, also returning an error code 1 (silent).
You can test this running manually the command:
/opt/zextras/bin/zmamavisdctl restart norewrite echo $?
The output will be:
Services are now handled by systemd. Enabled systemd targets: - carbonio-directory-server.target - carbonio-appserver.target - carbonio-proxy.target - carbonio-mta.target Please check the documentation for further details. Exiting. 1
Note the 1 at the end, that triggers the cron job to send an error e-mail.
@sharif You probably are receiving the e-mail, check your notification recipients.
now...we could add zextras to sudoers to run a systemctl restart command but I would like to know beforehand which is the corret service that needs to be restarted nowadays:
carbonio-antivirus.service?
carbonio-clamav-sidecar.service?
carbonio-clamav-signature-provider-sidecar.service?
carbonio-mta-sidecar.service?
carbonio-mta.target?
Our devs are aligned with this issue. I sincerely thank you for taking your time and effort to point out this to us🙏