Ad Widget

Collapse

Zabbix Pre 1.5 Build 4666: Can't recreate ZABBIX semaph

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 753713
    Senior Member
    • Apr 2006
    • 137

    #16
    ------ Shared Memory Limits --------
    max number of segments = 4096
    max seg size (kbytes) = 32768
    max total shared memory (pages) = 2097152
    min seg size (bytes) = 1

    ------ Semaphore Limits --------
    max number of arrays = 128
    max semaphores per array = 250
    max semaphores system wide = 32000
    max ops per semop call = 32
    semaphore max value = 32767

    ------ Messages: Limits --------
    max queues system wide = 16
    max size of message (bytes) = 8192
    default max size of queue (bytes) = 16384


    Thanks,
    Christian
    ______________________________
    Version : 2.0.x
    Server OS: Ubuntu 12.04
    Zabbix Servers: 12
    Monitored Windows Server: ~ 1000
    ______________________________

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #17
      Also, make sure you do not start the zabbix_server or zabbix_agentd from a root account.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #18
        Originally posted by 753713
        Ideas for my problem???
        I do not see any problem here. Are you sure the server was not started? If so, please, show us the server's log file.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • 753713
          Senior Member
          • Apr 2006
          • 137

          #19
          Hi,
          here my logfile:
          /home/zabbix/bin/zabbix_server [4078]: Warning: ZABBIX semaphores already exist, trying to recreate.
          /home/zabbix/bin/zabbix_server [4078]: ERROR: Can't recreate ZABBIX semaphores for IPC key 0x7a01353c Semaphore ID 131073. Operation not permitted.
          /home/zabbix/bin/zabbix_server [4111]: Warning: ZABBIX semaphores already exist, trying to recreate.
          /home/zabbix/bin/zabbix_server [4111]: ERROR: Can't recreate ZABBIX semaphores for IPC key 0x7a01353c Semaphore ID 163841. Operation not permitted.
          /home/zabbix/bin/zabbix_server [4115]: Warning: ZABBIX semaphores already exist, trying to recreate.
          /home/zabbix/bin/zabbix_server [4115]: ERROR: Can't recreate ZABBIX semaphores for IPC key 0x7a01353c Semaphore ID 196609. Operation not permitted.

          I have tried zabbix server 3 x to start

          Christian
          ______________________________
          Version : 2.0.x
          Server OS: Ubuntu 12.04
          Zabbix Servers: 12
          Monitored Windows Server: ~ 1000
          ______________________________

          Comment

          • rreilly
            Member
            • May 2007
            • 61

            #20
            I have checked out the latest version today and I am also having the same problem. I can manually remove them but i get the same error when I try to start the server, says it can not create them but it does create but does not start the server.
            /opt/zabbix/sbin/zabbix_server [8431]: Warning: ZABBIX semaphores already exist, trying to recreate.
            /opt/zabbix/sbin/zabbix_server [8431]: ERROR: Can't recreate ZABBIX semaphores for IPC key 0x7a0483c1 Semaphore ID 753673. Operation not permitted.

            0x630483c1 983058 root 666 32120012 0

            ------ Semaphore Arrays --------
            key semid owner perms nsems
            0x7a0483c1 753673 root 666 3

            ------ Message Queues --------
            key msqid owner perms used-bytes messages

            Comment

            • rreilly
              Member
              • May 2007
              • 61

              #21
              This only happens on gentoo, same version works fine on OpenSUSE 10.2
              Rob

              Comment

              • theologu
                Junior Member
                • Dec 2007
                • 23

                #22
                semaphores again

                Hi, this is my first post here.

                I tried to use pre-zabbix 1.5 rev. 5150 on Slackware 12 but I have some problems.

                Kernel is 2.6.23.9, glibc 2.7, Postgres 8.2.5 as DB

                The first problem was at configure time with net-snmp:

                checking for net-snmp-config... /usr/bin/net-snmp-config
                checking for main in -lnetsnmp ... no
                configure: error: Not found NET-SNMP library

                I had to add in configure script...

                from CFLAGS="${CFLAGS} ${SNMP_CFLAGS}" in CFLAGS="${CFLAGS} ${SNMP_CFLAGS} -lcrypto"

                Ok, with this hack it compiled and installed as supposed.

                But now I have another problem, when i try to run zabbix-server it does not start and in log file appears:

                zabbix_server [2534]: Warning: ZABBIX semaphores already exist, trying to recreate.
                zabbix_server [2534]: ERROR: Can't recreate ZABBIX semaphores for IPC key 0x7a02bf8c Semaphore ID 524298. Operation not permitted.

                My ipcs -l shows:

                ------ Shared Memory Limits --------
                max number of segments = 4096
                max seg size (kbytes) = 32768
                max total shared memory (pages) = 2097152
                min seg size (bytes) = 1

                ------ Semaphore Limits --------
                max number of arrays = 128
                max semaphores per array = 250
                max semaphores system wide = 32000
                max ops per semop call = 100
                semaphore max value = 32767

                ------ Messages: Limits --------
                max queues system wide = 16
                max size of message (bytes) = 8192
                default max size of queue (bytes) = 16384

                and ipcs -a :

                ------ Shared Memory Segments --------
                key shmid owner perms bytes nattch status
                0x0052e2c1 0 postgres 600 29237248 2
                0x6302bf8c 196609 root 666 32120012 0

                ------ Semaphore Arrays --------
                key semid owner perms nsems
                0x00000000 32768 apache 600 1
                0x00000000 65537 apache 600 1
                0x00000000 98306 apache 600 1
                0x0052e2c1 131075 postgres 600 17
                0x0052e2c2 163844 postgres 600 17
                0x0052e2c3 196613 postgres 600 17
                0x0052e2c4 229382 postgres 600 17
                0x0052e2c5 262151 postgres 600 17
                0x0052e2c6 294920 postgres 600 17
                0x0052e2c7 327689 postgres 600 17
                0x7a02bf8c 524298 root 666 3

                ------ Message Queues --------
                key msqid owner perms used-bytes messages


                I tryed to remove the semaphore, but the same error.

                Here is a strace on zabbix_server:


                open("/etc/zabbix/zabbix_server.conf", O_RDONLY) = 3
                fstat64(3, {st_mode=S_IFREG|0644, st_size=3525, ...}) = 0
                mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fdf000
                read(3, "# This is config file for ZABBIX"..., 4096) = 3525
                read(3, "", 4096) = 0
                close(3) = 0
                munmap(0xb7fdf000, 4096) = 0
                stat64("/etc/zabbix/zabbix_server.conf", {st_mode=S_IFREG|0644, st_size=3525, ...}) = 0
                shmget(0x6302bf8c, 32120012, IPC_CREAT|IPC_EXCL|0666) = -1 EEXIST (File exists)
                shmget(0x6302bf8c, 0, 0666) = 163841
                shmctl(163841, IPC_64|IPC_RMID, 0) = 0
                shmget(0x6302bf8c, 32120012, IPC_CREAT|IPC_EXCL|0666) = 196609
                shmat(196609, 0, 0) = 0xb5cd8000
                stat64("/etc/zabbix/zabbix_server.conf", {st_mode=S_IFREG|0644, st_size=3525, ...}) = 0
                semget(0x7a02bf8c, 3, IPC_CREAT|IPC_EXCL|0666) = -1 EEXIST (File exists)
                getpid() = 2538
                write(2, "/usr/local/sbin/zabbix_server [2"..., 38/usr/local/sbin/zabbix_server [2538]: ) = 38
                write(2, "Warning: ZABBIX semaphores alrea"..., 61Warning: ZABBIX semaphores already exist, trying to recreate.) = 61
                write(2, "\n", 1
                ) = 1
                semget(0x7a02bf8c, 0, 0666) = 491530
                semctl(491530, 0, IPC_64|IPC_RMID, 0xbf995f68) = 0
                semget(0x7a02bf8c, 3, IPC_CREAT|IPC_EXCL|0666) = 524298
                semctl(524298, 0, IPC_64|SETVAL, 0xbf995f68) = 0
                semctl(524298, 1, IPC_64|SETVAL, 0xbf995f68) = 0
                semop(524298, 0xbf995f72, 1) = 0
                semop(524298, 0xbf995f72, 1) = 0
                semctl(524298, 2, IPC_64|SETVAL, 0xbf995f68) = 0
                semop(524298, 0xbf995f72, 1) = 0
                semop(524298, 0xbf995f72, 1) = 0
                getuid32() = 0
                socket(PF_FILE, SOCK_STREAM, 0) = 3
                fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
                connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
                close(3) = 0
                socket(PF_FILE, SOCK_STREAM, 0) = 3
                fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
                connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
                close(3) = 0
                open("/etc/nsswitch.conf", O_RDONLY) = 3
                fstat64(3, {st_mode=S_IFREG|0644, st_size=1083, ...}) = 0
                mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fdf000
                read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1083
                read(3, "", 4096) = 0
                close(3) = 0
                munmap(0xb7fdf000, 4096) = 0
                open("/etc/ld.so.cache", O_RDONLY) = 3
                fstat64(3, {st_mode=S_IFREG|0644, st_size=39969, ...}) = 0
                mmap2(NULL, 39969, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd6000
                close(3) = 0
                open("/lib/libnss_compat.so.2", O_RDONLY) = 3
                read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\000 0\16\0"..., 512) = 512
                fstat64(3, {st_mode=S_IFREG|0755, st_size=35527, ...}) = 0
                mmap2(NULL, 33352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5ccf000
                mmap2(0xb5cd6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xb5cd6000
                close(3) = 0
                open("/lib/libnsl.so.1", O_RDONLY) = 3
                read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0 \0 1\0\000"..., 512) = 512
                fstat64(3, {st_mode=S_IFREG|0755, st_size=101037, ...}) = 0
                mmap2(NULL, 96232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5cb7000
                mmap2(0xb5ccb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13) = 0xb5ccb000
                mmap2(0xb5ccd000, 6120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb5ccd000
                close(3) = 0
                mprotect(0xb5ccb000, 4096, PROT_READ) = 0
                mprotect(0xb5cd6000, 4096, PROT_READ) = 0
                munmap(0xb7fd6000, 39969) = 0
                open("/etc/ld.so.cache", O_RDONLY) = 3
                fstat64(3, {st_mode=S_IFREG|0644, st_size=39969, ...}) = 0
                mmap2(NULL, 39969, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd6000
                close(3) = 0
                open("/lib/libnss_nis.so.2", O_RDONLY) = 3
                read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0 \31\0"..., 512) = 512
                fstat64(3, {st_mode=S_IFREG|0755, st_size=41034, ...}) = 0
                mmap2(NULL, 37436, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5cad000
                mmap2(0xb5cb5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7) = 0xb5cb5000
                close(3) = 0
                open("/lib/libnss_files.so.2", O_RDONLY) = 3
                read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\3 00\30"..., 512) = 512
                fstat64(3, {st_mode=S_IFREG|0755, st_size=45549, ...}) = 0
                mmap2(NULL, 41624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5ca2000
                mmap2(0xb5cab000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8) = 0xb5cab000
                close(3) = 0
                mprotect(0xb5cab000, 4096, PROT_READ) = 0
                mprotect(0xb5cb5000, 4096, PROT_READ) = 0
                munmap(0xb7fd6000, 39969) = 0
                open("/etc/passwd", O_RDONLY|0x80000 /* O_??? */) = 3
                fcntl64(3, F_GETFD) = 0x1 (flags FD_CLOEXEC)
                _llseek(3, 0, [0], SEEK_CUR) = 0
                fstat64(3, {st_mode=S_IFREG|0644, st_size=1094, ...}) = 0
                mmap2(NULL, 1094, PROT_READ, MAP_SHARED, 3, 0) = 0xb7fdf000
                _llseek(3, 1094, [1094], SEEK_SET) = 0
                munmap(0xb7fdf000, 1094) = 0
                close(3) = 0
                setgid32(100) = 0
                open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 3
                read(3, "65536\n", 31) = 6
                close(3) = 0
                socket(PF_FILE, SOCK_STREAM, 0) = 3
                fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
                connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
                close(3) = 0
                socket(PF_FILE, SOCK_STREAM, 0) = 3
                fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
                connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
                close(3) = 0
                open("/etc/group", O_RDONLY|0x80000 /* O_??? */) = 3
                _llseek(3, 0, [0], SEEK_CUR) = 0
                fstat64(3, {st_mode=S_IFREG|0644, st_size=636, ...}) = 0
                mmap2(NULL, 636, PROT_READ, MAP_SHARED, 3, 0) = 0xb7fdf000
                _llseek(3, 636, [636], SEEK_SET) = 0
                fstat64(3, {st_mode=S_IFREG|0644, st_size=636, ...}) = 0
                munmap(0xb7fdf000, 636) = 0
                close(3) = 0
                setgroups32(1, [100]) = 0
                setuid32(1001) = 0
                setresgid32(-1, 100, -1) = 0
                setresuid32(-1, 1001, -1) = 0
                clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGC HLD, child_tidptr=0xb7b7a708) = 2539
                --- SIGCHLD (Child exited) @ 0 (0) ---


                If I run:

                su zabbix -c "/usr/local/sbin/zabbix_server" the following error appears:

                /usr/local/sbin/zabbix_server [2554]: ERROR: Can't recreate shared memory for database cache. [too many attempts]

                So my frineds, any ideas?

                Please note that 1.4.3 and 1.4.4 works ok! (after configure hack)

                Comment

                • jean
                  Member
                  • Apr 2006
                  • 85

                  #23
                  Same problem here with zabbix 1.5 (27.12.2007) and Ubuntu 6.06 LTS. When I try to start zabbix 1.5, the message for semaphore appear and if I want to start zabbix 1.4.4 after, I need to clean the semaphore with ipcrm -s semid. Someone have find a solution to this problem ?

                  Comment

                  • jean
                    Member
                    • Apr 2006
                    • 85

                    #24
                    OK, the problem was that root will start the zabbix server daemon. The first thing to do is to erase the semaphore for the old zabbix server if they have not already done with ipcs and ipcrm command. After, a little modification of the start script as follow :

                    before : start-stop-daemon --oknodo --start --pidfile $PID --exec $DAEMON
                    after : start-stop-daemon --oknodo --start --pidfile $PID --chuid zabbix --exec $DAEMON

                    and the zabbix server will work !

                    Comment

                    • 753713
                      Senior Member
                      • Apr 2006
                      • 137

                      #25
                      Hi,

                      sorry for delay,

                      I have tested the new start-script:
                      start-stop-daemon --oknodo --start --pidfile $PID --chuid zabbix --exec $DAEMON

                      and my zabbix server 1.5 (05.01.2008) running without problems .


                      thanks
                      Christian
                      ____________________________
                      Version : 1.4.4
                      Monitored Windows Server: ~ 300
                      ____________________________
                      Last edited by 753713; 16-01-2008, 21:14.
                      ______________________________
                      Version : 2.0.x
                      Server OS: Ubuntu 12.04
                      Zabbix Servers: 12
                      Monitored Windows Server: ~ 1000
                      ______________________________

                      Comment

                      • skullone
                        Member
                        • Mar 2007
                        • 46

                        #26
                        Same semaphore errors here:
                        FreeBSD 6.2, I get operation not permitted when re-creating semaphores.
                        I can post logs, but its pretty much identical as others.

                        The FreeBSD startup script starts it as root, and I assume suid's to the zabbix user, which may be why its not allowed to recreate shared semaphores made by root.

                        Zabbix doesnt have a shell or home directory on my system, so it will be a while before I verify.

                        As it stands, only 1.4.1 is actually stable on my system.
                        1.4.2, 1.4.3, 1.4.4 all crash while trying to Add hosts via the Discover function.

                        Comment

                        • NOB
                          Senior Member
                          Zabbix Certified Specialist
                          • Mar 2007
                          • 469

                          #27
                          Hi

                          Originally posted by skullone
                          Same semaphore errors here:
                          FreeBSD 6.2, I get operation not permitted when re-creating semaphores.
                          I can post logs, but its pretty much identical as others.

                          The FreeBSD startup script starts it as root, and I assume suid's to the zabbix user, which may be why its not allowed to recreate shared semaphores made by root.

                          Zabbix doesnt have a shell or home directory on my system, so it will be a while before I verify.

                          As it stands, only 1.4.1 is actually stable on my system.
                          1.4.2, 1.4.3, 1.4.4 all crash while trying to Add hosts via the Discover function.
                          I have ZABBIX 1.4.2 (plus some fixes) running without any problem
                          on two FreeBSD-6.2 installations (i386 + Sparc64), using PostgreSQL 8.2.4
                          from the ports.

                          No problems with Semaphores, whatsoever.
                          Perhaps this was modified/added in a later version.

                          However, I never start the ZABBIX-Server as user "root".
                          In the startup script I just call something like
                          Code:
                          su - zabbix -c "zabbix_server parameters"
                          Hope this helps

                          Norbert.

                          Comment

                          • wanga
                            Junior Member
                            • Dec 2007
                            • 2

                            #28
                            I'm also experiencing this on 1.4.4 with 64bit CentOS - kernel-2.6.18-8.el5

                            Particularly the following:
                            /usr/local/zabbix/sbin/zabbix_server [28451]: ERROR: Can't recreate ZABBIX semaphores for IPC key 0x7a028093 Semaphore ID 0. Operation not permitted.

                            Originally posted by ipcs -a
                            ------ Shared Memory Segments --------
                            key shmid owner perms bytes nattch status
                            0x63028093 0 root 666 32560024 0

                            ------ Semaphore Arrays --------
                            key semid owner perms nsems
                            0x7a028093 0 root 666 3

                            Comment

                            • jonnjonzzn
                              Junior Member
                              • Sep 2007
                              • 18

                              #29
                              Me too!

                              I'm also seeing this. I have tried all posted suggestions, from scratch install, etc. I have tried on both a CentOS 5 and Ubuntu 6.06 server. No go on either.

                              Please help!

                              -Mike
                              Last edited by jonnjonzzn; 07-02-2008, 22:22.

                              Comment

                              • Palmertree
                                Senior Member
                                • Sep 2005
                                • 746

                                #30
                                Make sure you start the zabbix_server daemon with a user account besides root.

                                Comment

                                Working...