Ad Widget

Collapse

Solaris 8 compile problems w v1.3.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fjnperf
    Junior Member
    • Jan 2006
    • 9

    #1

    Solaris 8 compile problems w v1.3.4

    Hi, I've been trying to compile v1.3.4 on solaris8, and having some issues I believe with FLOCK

    I've tried configuring it with both of the following config statements,
    ./configure --enable-server --with-mysql=/opt/mysql --enable-agent --includedir=/usr/ucbinclude --with-net-snmp

    ./configure --enable-server --with-mysql=/opt/mysql --enable-agent --includedir=/usr/ucbinclude --with-net-snmp --disable-flock --enable-fcntl

    With pretty much the same results.

    Any help from any of you Compile Masters would be appreciated!

    Here are the Errors I am getting (sorry for the omission)

    pid.c:43: error: 'LOCK_EX' undeclared (first use in this function)
    pid.c:43: error: (Each undeclared identifier is reported only once
    pid.c:43: error: for each function it appears in.)
    pid.c:43: error: 'LOCK_NB' undeclared (first use in this function)
    pid.c: In function 'drop_pid_file':
    pid.c:75: error: 'LOCK_UN' undeclared (first use in this function)
    make[3]: *** [pid.o] Error 1
    make[3]: Leaving directory `/tmp/zabbix-1.3.4/src/libs/zbxnix'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/tmp/zabbix-1.3.4/src/libs'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/tmp/zabbix-1.3.4/src'
    make: *** [all-recursive] Error 1

    Forrest Nielson
    State of Utah
    Last edited by fjnperf; 04-04-2007, 18:58. Reason: Add error codes
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Please give us error messages.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • fjnperf
      Junior Member
      • Jan 2006
      • 9

      #3
      RE Solaris 8 compile problems with v1.3.4

      I edited my original post, and added the error codes to it, sorry about the omission

      Also, thought I would add that I have a working v1.1.7 agent and server running on this system which were built on this box.

      Comment

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

        #4
        Hi,

        I temporarily solved it by commenting the corresponding lines of code.
        However, there is another problem in the code which appears
        only during the final link state of the agent.

        I fixed it by changing the line 53 in src/libs/zbxsysinfo/solaris/cpu.c
        from
        Code:
        snprintf(ks_name, sizeof(ks_name), "cpu_stat%s", cpuname);
        to
        Code:
        zbx_snprintf(ks_name, sizeof(ks_name), "cpu_stat%s", cpuname);
        Hope this helps,

        Norbert.

        Comment

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

          #5
          The cpu_stat typo has bee fixed.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • zabbixfan
            Junior Member
            • Apr 2007
            • 1

            #6
            Originally posted by fjnperf
            Hi, I've been trying to compile v1.3.4 on solaris8, and having some issues I believe with FLOCK

            I've tried configuring it with both of the following config statements,
            ./configure --enable-server --with-mysql=/opt/mysql --enable-agent --includedir=/usr/ucbinclude --with-net-snmp

            ./configure --enable-server --with-mysql=/opt/mysql --enable-agent --includedir=/usr/ucbinclude --with-net-snmp --disable-flock --enable-fcntl

            With pretty much the same results.

            Any help from any of you Compile Masters would be appreciated!

            Here are the Errors I am getting (sorry for the omission)

            pid.c:43: error: 'LOCK_EX' undeclared (first use in this function)
            pid.c:43: error: (Each undeclared identifier is reported only once
            pid.c:43: error: for each function it appears in.)
            pid.c:43: error: 'LOCK_NB' undeclared (first use in this function)
            pid.c: In function 'drop_pid_file':
            pid.c:75: error: 'LOCK_UN' undeclared (first use in this function)
            make[3]: *** [pid.o] Error 1
            make[3]: Leaving directory `/tmp/zabbix-1.3.4/src/libs/zbxnix'
            make[2]: *** [all-recursive] Error 1
            make[2]: Leaving directory `/tmp/zabbix-1.3.4/src/libs'
            make[1]: *** [all-recursive] Error 1
            make[1]: Leaving directory `/tmp/zabbix-1.3.4/src'
            make: *** [all-recursive] Error 1

            Forrest Nielson
            State of Utah
            Hello,

            I have this exact issue trying to compile the latest 1.3.5 beta, although I am on Solaris 10. I have configured many versions of zabbix on linux without issue (and have been running ti and loving it for several years now), but trying to get it compiled and finished with "make install" has been quite a time consuming task.

            Trying to figure out what I need to do. Have tried including the file.h header in pid.c (while copying it to the zabbix install include file from /usr/ucbinclude/sys/), which got me farther, however, I then get the following symbol ref error.

            ------------------------------------

            /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -I. -I../../include -DZABBIX_DAEMON -g -I/usr/sfw/include/mysql -xstrconst -mt -c -o zabbix_server-server.o `test -f 'server.c' || echo './'`server.c
            /opt/SUNWspro/bin/cc -g -I/usr/sfw/include/mysql -xstrconst -mt -R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lm -lz -o zabbix_server zabbix_server-evalfunc.o zabbix_server-expression.o zabbix_server-actions.o zabbix_server-operations.o zabbix_server-events.o zabbix_server-zlog.o zabbix_server-functions.o zabbix_server-server.o alerter/libzbxalerter.a discoverer/libzbxdiscoverer.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a timer/libzbxtimer.a trapper/libzbxtrapper.a nodewatcher/libzbxnodewatcher.a utils/libzbxutils.a httppoller/libzbxhttppoller.a watchdog/libzbxwatchdog.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/solaris/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxemail/libzbxemail.a ../../src/libs/zbxsms/libzbxsms.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a -lkvm -lresolv -lnsl -lkstat -lsocket
            Undefined first referenced
            symbol in file
            flock ../../src/libs/zbxnix/libzbxnix.a(pid.o)
            ld: fatal: Symbol referencing errors. No output written to zabbix_server
            *** Error code 1

            make: Fatal error: Command failed for target `zabbix_server'
            Current working directory /tmp/zabbix-1.3.5/src/zabbix_server
            *** Error code 1
            The following command caused the error:
            failcom='exit 1'; \

            --------------------------

            Thanks in advance...

            Comment

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

              #7
              Hi,

              I didn't bother to use the old UCB (University of California at Berkeley) stuff.
              It's nice and will work. AFAIK, however, these libraries are not
              thread-safe (not reentrant) and there is no plan to fix this.

              They are intended just for (temporary) porting of Berkeley-style
              programs and a goddie for the (very) old Sun users being used
              to Sun OS 1.x which was based on Berkeley UNIX (BSD).

              No wonder, there is no problem on Linux: They copied a lot of stuff
              from BSD UNIX (original Berkeley distribution). No problem on
              any of the FreeBSD, OpenBSD, NetBSD variants either, I guess.

              But if you insist, you should link the program with /usr/ucblib/libucb.so.
              This includes the flock function.
              I think the parameters you need for the linking are
              Code:
              -L /usr/ucblib -lucb
              The real fix would be to replace this code by calls to the fcntl API.
              If I find some spare time, I'll try it.
              This must have been done by others, anyway.

              HTH,

              Norbert.
              Last edited by NOB; 26-04-2007, 07:56. Reason: Misspelled fcntl

              Comment

              • fjnperf
                Junior Member
                • Jan 2006
                • 9

                #8
                Thanks for the recommendation/help
                I recompiled with LDFLAGS set to link the /usr/ucblib but unfortunately I'm still experiencing the same errors; If anybody has any suggestions, or has applied a fix to the pid.c, I'd sure appreciate any responses!

                Thanks Again,
                Forrest Nielson

                Code:
                Configuration:
                
                  Detected OS:	  solaris2.8
                  Install path:	 /usr/local
                  Compilation arch: solaris
                
                  Compiler:		 gcc
                  Compiler flags:   -g -O2
                  Linker flags:	 -L /usr/ucblib -lucb	-lm -lz   -lkvm -lresolv -lnsl -lkstat -lsocket
                
                  Enable server:	yes
                  With database:	MySQL
                
                  Enable agent:	 no
                
                pid.c: In function 'create_pid_file':
                pid.c:43: error: 'LOCK_EX' undeclared (first use in this function)
                pid.c:43: error: (Each undeclared identifier is reported only once
                pid.c:43: error: for each function it appears in.)
                pid.c:43: error: 'LOCK_NB' undeclared (first use in this function)
                pid.c: In function 'drop_pid_file':
                pid.c:75: error: 'LOCK_UN' undeclared (first use in this function)
                make[3]: *** [pid.o] Error 1
                make[3]: Leaving directory `/tmp/zabbix-1.3.4/src/libs/zbxnix'
                make[2]: *** [all-recursive] Error 1
                make[2]: Leaving directory `/tmp/zabbix-1.3.4/src/libs'
                make[1]: *** [all-recursive] Error 1
                make[1]: Leaving directory `/tmp/zabbix-1.3.4/src'
                make: *** [all-recursive] Error 1

                Comment

                • bobster
                  Junior Member
                  • Feb 2007
                  • 7

                  #9
                  Any plans to remediate?

                  Same problem here; in this case, version of Solaris I'm running is 2.9 however.

                  This same compilation issue occured when I tried to compile the PATCHED version of 1.1.7 . I decided to try 1.3.4 in the hopes this had been corrected but its clear it was never addressed.

                  BIG QUESTION: Is there any plans to remediate this issue? Our group is currently stuck with the unpatched version 1.1.7 - which unfortunately has some serious issues in which UserParameter checks don't work on Win32, log monitoring doesn't work on Win32, trigger, template issues, etc...

                  Comment

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

                    #10
                    Hi,

                    Edited: See this thread for a solution

                    Quick and dirty (preliminary) patch removed.

                    HTH,

                    Norbert.
                    Last edited by NOB; 03-05-2007, 11:01.

                    Comment

                    Working...