1 (edited by cvcvelo 2025-02-18 05:03:50)

Topic: Faster restarts for SOGo on Debian

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.2
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Debian 12.9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL (MariaDB)
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Restarts of the SOGo process after nightly upgrades were taking about 20 seconds, with almost all of that coming from the stop command.

On Debian, this is because the systemd script in /etc/init.d/sogo uses the SIGTERM signal to try stopping the program, but systemd does not know how to do that with a SIGTERM signal. Instead the script waits for the 20-second timeout before just sending a SIGKILL symbol:

start-stop-daemon -c $USER --stop --pidfile $PIDFILE --retry=TERM/20/KILL/5 --oknodo
        rm -f $PIDFILE

As I learned with different program running on Debian, SIGTERM and SIGINT *should* be equivalent with systemd but they’re not. Only a SIGINT signal will stop the process.

On my system, I edited lines 80 and 87 of the /etc/init.d/sogo script to read like this:

start-stop-daemon -c $USER --stop --pidfile $PIDFILE --retry=INT/20/KILL/5 --oknodo
        rm -f $PIDFILE

After running ‘systemctl daemon-reload’, as with any change to startup/shutdown scripts, the system now stops (and restarts) SOGo almost instantaneously.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Faster restarts for SOGo on Debian

Please report this issue to SOGo team, they maintain /etc/init.d/sogo:
https://www.sogo.nu/support.html

3

Re: Faster restarts for SOGo on Debian

Done, thanks.

I installed SOGo around 2020 as part of an iRedMail server build, and don’t remember the exact method I used for installation. The SOGo docs suggest just installing from packages:

https://www.sogo.nu/support/faq/how-to- … ebian.html

Fully agree this should run under systemd and use stop/restart signals systemd can understand. Thanks again.

4

Re: Faster restarts for SOGo on Debian

Hello,

I upgraded debain 9 to Debain 10 but after upgrade mails are not working in mail client .looks like its something with dovecon.conf issue .i am pasting error of dovecon below .please suggest.

imap-login: Error: Failed to initialize SSL server context: Unknown ssl_min_protocol se
Feb 25 04:44:55 mx1.tedwiberg.se dovecot[18641]: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Feb 25 04:44:55 mx1.tedwiberg.se dovecot[18641]: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/lib20_auth_var_expand_crypt.s
Feb 25 04:44:55 mx1.tedwiberg.se dovecot[18641]: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Feb 25 04:44:55 mx1.tedwiberg.se dovecot[18641]: auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat
Feb 25 04:44:55 mx1.tedwiberg.se dovecot[18641]: auth: Debug: passwd-file /etc/dovecot/dovecot-master-users: Read 0 users in 0 secs
Feb 25 04:44:57 mx1.tedwiberg.se dovecot[18641]: auth: Debug: auth client connected (pid=18651)
Feb 25 04:44:57 mx1.tedwiberg.se dovecot[18641]: imap-login: Error: Failed to initialize SSL server context: Unknown ssl_min_protocol se
Feb 25 04:45:01 mx1.tedwiberg.se dovecot[18641]: auth: Debug: auth client connected (pid=18652)
Feb 25 04:45:01 mx1.tedwiberg.se dovecot[18641]: imap-login: Error: Failed to initialize SSL server context: Unknown ssl_min_protocol se