We recommend creating a zabbix user as system user, that is, without ability to log in. Some users ignore this recommendation and use the same account to log in (e. g. using SSH) to host running Zabbix. This might crash Zabbix daemon on log out. In this case you will get something like the following in Zabbix server log:
zabbix_server : [file:'selfmon.c',line:375] lock failed:  Invalid argument zabbix_server : [file:'dbconfig.c',line:5266] lock failed:  Invalid argument zabbix_server : [file:'log.c',line:238] lock failed:  Invalid argument
and in Zabbix agent log:
zabbix_agentd : [file:'log.c',line:238] lock failed:  Invalid argument
This happens because of default systemd setting
RemoveIPC=yes configured in
/etc/systemd/logind.conf. When you log out of the system the semaphores created by Zabbix previously are removed which causes the crash.
A quote from systemd documentation:
RemoveIPC= Controls whether System V and POSIX IPC objects belonging to the user shall be removed when the user fully logs out. Takes a boolean argument. If enabled, the user may not consume IPC resources after the last of the user's sessions terminated. This covers System V semaphores, shared memory and message queues, as well as POSIX shared memory and message queues. Note that IPC objects of the root user and other system users are excluded from the effect of this setting. Defaults to "yes".
There are 2 solutions to this problem:
/etc/systemd/logind.confand reboot the system. Note that
RemoveIPCis a system-wide parameter, changing it will affect the whole system.