[ZBX-11544] File locks failed on zabbix server and zabbix agent Created: 2016 Dec 01  Updated: 2024 Apr 10  Resolved: 2018 Jul 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D)
Affects Version/s: None
Fix Version/s: 4.0 (plan)

Type: Documentation task Priority: Minor
Reporter: Roger Assignee: Martins Valkovskis
Resolution: Fixed Votes: 1
Labels: lock, semaphores, ssh, systemd
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu Server 16.04 LTS 64bit
Linux 4.4.0-47-generic
Zabbix server and agent 3.0.3 (revision 60173)


Team: Team D
Team: Team D
Sprint: Sprint 33, Sprint 34, Sprint 35, Sprint 36, Sprint 37, Sprint 38
Story Points: 1

 Description   

During installation of Ubuntu server 16.04 I created an user called "zabbix".
To install zabbix server and agent i downloaded the sources and compiled it.
Both zabbix server and agent are using the user "zabbix" (it's the configuration by default).
The problem is: I connect by ssh to the server with the user "zabbix" and when i type "exit" (to logout) the zabbix server and agent crashes with the following information on the logs:

zabbix_server [27730]: [file:'selfmon.c',line:375] lock failed: [22] Invalid argument
zabbix_server [27716]: [file:'dbconfig.c',line:5266] lock failed: [22] Invalid argument
zabbix_server [27706]: [file:'log.c',line:238] lock failed: [22] Invalid argument

zabbix_agentd [27796]: [file:'log.c',line:238] lock failed: [22] Invalid argument

As a workaround i just login as another user, but has this issue an official fix?

Thank you.



 Comments   
Comment by Alexey Pustovalov [ 2016 Dec 01 ]

can not reproduce the issue. Please tell us how you added "zabbix" user.

Comment by Roger [ 2016 Dec 01 ]

I didn't added "zabbix" user, i just created it during installation.
The user is a common user, included on the "sudo" group and other groups by default.
Would you like full info about this user (shadow, group, etc)?

Comment by Alexey Pustovalov [ 2016 Dec 01 ]

Yes, show us how you created it.

Comment by Roger [ 2016 Dec 01 ]

By default, after installation, the created user has this configuration:

  • passwd: zabbix:x:1000:1000:zabbix,,,:/home/zabbix:/bin/bash
  • shadow: zabbix:password goes here:16952:0:99999:7:::
  • group:
    adm:x:4:syslog,zabbix
    cdrom:x:24:zabbix
    sudo:x:27:zabbix
    dip:x:30:zabbix
    plugdev:x:46:zabbix
    lxd:x:110:zabbix
    zabbix:x:1000:
    lpadmin:x:113:zabbix
    sambashare:x:114:zabbix
  • gshadow:
    adm:*::syslog,zabbix
    cdrom:*::zabbix
    sudo:*::zabbix
    dip:*::zabbix
    plugdev:*::zabbix
    lxd:!::zabbix
    zabbix:!::
    lpadmin:!::zabbix
    sambashare:!::zabbix

Did I forget something?

Comment by Aleksandrs Saveljevs [ 2016 Dec 05 ]

Looks like a duplicate of ZBX-3974.

Comment by Roger [ 2016 Dec 05 ]

In this case I only have one server and one agent. It seems not to be a descriptors or semaphores problem.
Unlike "Michael Quigley" in ZBX-3974, It only happens with the "zabbix" user: if I connect via SSH using the "zabbix" user I can tail the log and create and modify another files, the problem occurs when I exit the SSH session, at this moment the zabbix server and agent crashes.
If I just log in with the user "root" everything is fine: i can restart the zabbix server and agent and exit the ssh session without problems.
I don't need to apply any workaround, neither commands to keep zabbix server and agent running. It has been working all weekend, even with automatic mysql table partitioning (on the root's crontab).

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 06 ]

Dear rblancop, could you please execute commands mentioned in this comment?

Comment by Roger [ 2017 Feb 07 ]

Here you are:

root@zabbix:~# ipcs -s | grep zabbix
0x7a00544b 98305 zabbix 600 13
0x7a006daf 131074 zabbix 600 13

root@zabbix:~# printf '%0.2x%0.4x\n' $(($(stat -c '%d' /etc/zabbix/zabbix_server.conf) & 0xff)) $(($(stat -c '%i' /etc/zabbix/zabbix_server.conf) & 0xffff))
006daf

root@zabbix:~# printf '%0.2x%0.4x\n' $(($(stat -c '%d' /etc/zabbix/zabbix_agentd.conf) & 0xff)) $(($(stat -c '%i' /etc/zabbix/zabbix_agentd.conf) & 0xffff))
00544b

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 07 ]

Your problem is not the same as ZBX-3974.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 07 ]

Maybe semaphores are removed by system when user who created them (cuid) logs out?

Comment by Roger [ 2017 Feb 07 ]

It could be, but how can i check it?
As i wrote on description, files and zabbix application owns to an user named "zabbix". If i login as "zabbix" and then logout, the locks fails.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 07 ]

A brief test on my CentOS 7 with Oracle 11 XE installed. I login via ssh as zabbix, create semaphore using ipcmk -S ... and logout. Semaphore is removed, I verify it in a parallel ssh session under root. I login as oracle, create semaphore and logout - semaphore stays in place. How does oracle manages it? There must be a system setting for this. Yes, there is! From man logind.conf:

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".

Seems there is nothing to fix in the code. kodai, is there something we can improve in packages? Or is it purely documentation issue then?

Comment by Roger [ 2017 Feb 07 ]

On my ubuntu 16.04 I've established the parameter "RemoveIPC=no" on the file /etc/systemd/logind.conf
After a restart it's working correctly. Thank you!

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 23 ]

One more case of the same problem.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Feb 23 ]

Let's document it.

Comment by dimir [ 2018 Jul 06 ]

martins-v, I have added recommended solution, as proposed by dotneft. Please review the 4.0 version https://www.zabbix.com/documentation/4.0/manual/appendix/other_issues and if all good copy to 2.2, 3.0 and 3.4 . Thanks!

martins-v Done. CLOSED.

Comment by dimir [ 2018 Jul 16 ]

Looks great now!

Generated at Fri Apr 19 07:09:42 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.