Doesn't build under osx

2»

Comments

  • Alright, here comes another try. Same procedure.
  • I got this working on my system a while back. I was able to port to utmpx successfully. I've since reformatted. $500 and its yours ;) jk. But I'm assuming whomever you're doing this for likes NR because no one can see that embarrasing X3watch logo on your dock right?
  • WTMPX_FILE not declared in this scope, means you ported it wrong. I'll try to find the code. I'm sure they have a new version out now though.

    *EDIT* Found it. Hope it still works.

    Try Mine:
  • Robert,

    v0.2 seems to have resolved all the utmpx issues (thanks for adding your version mr dmjohnson!), and running make now goes way farther, but fails at:

    libtool: link: ( cd ".libs" && rm -f "libNetResponsibility.la" && ln -s "../libNetResponsibility.la" "libNetResponsibility.la" )
    /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I./include -DPKGDATADIR='/usr/share/net-responsibility' -DPKGLIBDIR='/usr/lib/net-responsibility' -DDATABASEDIR='/var/log' -DPIDDIR='/var/run' -I./include -g -O2 -g -O2 -MT ./src/report_la-Report.lo -MD -MP -MF ./src/.deps/report_la-Report.Tpo -c -o ./src/report_la-Report.lo `test -f './src/Report.cpp' || echo './'`./src/Report.cpp
    libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./include -DPKGDATADIR=/usr/share/net-responsibility -DPKGLIBDIR=/usr/lib/net-responsibility -DDATABASEDIR=/var/log -DPIDDIR=/var/run -I./include -g -O2 -g -O2 -MT ./src/report_la-Report.lo -MD -MP -MF ./src/.deps/report_la-Report.Tpo -c ./src/Report.cpp -fno-common -DPIC -o ./src/.libs/report_la-Report.o
    libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./include -DPKGDATADIR=/usr/share/net-responsibility -DPKGLIBDIR=/usr/lib/net-responsibility -DDATABASEDIR=/var/log -DPIDDIR=/var/run -I./include -g -O2 -g -O2 -MT ./src/report_la-Report.lo -MD -MP -MF ./src/.deps/report_la-Report.Tpo -c ./src/Report.cpp -o ./src/report_la-Report.o >/dev/null 2>&1
    mv -f ./src/.deps/report_la-Report.Tpo ./src/.deps/report_la-Report.Plo
    /bin/sh ./libtool --tag=CXX --mode=link g++ -I./include -g -O2 -g -O2 -module -no-undefined -L/usr/local/lib -L/usr/lib -o report.la -rpath /usr/lib/net-responsibility ./src/report_la-Report.lo -lNetResponsibility -lpcap -lPocoNet -lPocoUtil -lPocoXML -lPocoZip -lPocoDataSQLite -lPocoData -lPocoFoundation
    libtool: link: g++ -o .libs/report.0.so -bundle ./src/.libs/report_la-Report.o -L/usr/local/lib -L/usr/lib -lNetResponsibility -lpcap -lPocoNet -lPocoUtil -lPocoXML -lPocoZip -lPocoDataSQLite -lPocoData -lPocoFoundation -O2 -O2
    ld: library not found for -lNetResponsibility
    collect2: ld returned 1 exit status
    make[1]: *** [report.la] Error 1
    make: *** [all] Error 2

    At first I thought it was an issue with my version of the POCO++ library, so I compiled and installed v1.4.6p1 using:

    make clean
    ./configure --shared --no-tests --no-samples --omit=Data/MySQL,Data/ODBC,Crypto,PageCompiler,PageCompiler/File2Page,NetSSL_OpenSSL,CppUnit
    make

    Unfortunately that wasn't actually the issue. Any thoughts?

    Thanks for working so hard on this! I really appreciate it. :)
  • > I got this working on my system a while back. I was able to port to utmpx successfully. I've since reformatted. $500 and its yours ;) jk. But I'm assuming whomever you're doing this for likes NR because no one can see that embarrasing X3watch logo on your dock right?

    Haha. It's not so much about the embarrassment as the functionality. NR just works better than any other accountability software I've used, in addition to being free and open source.

    If I can get this running on my computer, I'm hoping to make a package installer for OSX 10.8.4, at the very least.
  • Hey dmjohnson, did you ever get a launch script working on your system?
  • @johnbuck: The utmpx issue seems to be solved indeed. The issue you're facing now is a linking error. They can be _confusing_! Let me explain a bit how NR is assembled, and you might be able to sort things out.

    Most of the code ends up in a library, namely `libNetResponsibility`. The executable `net-responsibility` only contains the bare minimum required to load stuff from the library and run it. This is because big parts of the code is shared between the executable and modules. In 3.0.3 it is only one module, `report`.

    So what's happening here is that the report module does not find libNetResponsibility. I'm not sure why, and this is what we'll need to find out. It has nothing to do with external libraries, such as POCO, even though it was a good guess.

    The util that's creating the libraries, and refusing to complete, is called libtool.

    Please do some research to see if you can get it going. I'll do what I can too.

    @dmjohnson: Thanks for attaching your version! I've looked through it, and I'm glad you got it going. I would recommend the version above though (named BootHistory-0.2.tar.gz) since it's designed more from a utmpx perspective if you see what I mean.

    Did you also get the linking errors, and how did you deal with them?
  • The build issues have been resolved!

    I unzipped a clean copy of the source files to my desktop, replaced the boothistory.* files with the ones you provided, Robert, and then ran `sudo make`.

    NR built!

    I then ran `sudo make install`, which generated an error about `/etc/init.d/net-responsibility` not existing. On a whim (remembering something I read on these forums), I ran `sudo make install` again, which has NR running smoothly, generating reports, and working quite well, as far as I've seen.

    Hooray!

    I'll continue to test it and post any results or issues.

    My last question in regards to this particular topic is this: how can I get a launch script up and working on Mac OS X? Does the one posted actually work? It didn't the last time I tried to use it. :/
  • Some pretty great news!

    /etc/init.d/net-responsibility is related to the init script, so we should customize the OSX installation to omit it. I think the launchd script is outdated, so it would be really nice if you took a look at it and got it working ;) Some useful links for that:

    http://en.wikipedia.org/wiki/Launchd

    http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html

    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/launchd.8.html

    If you need any hints or information, we're here to help!
  • Okay, so attached is what I've got, and it seems to be working.

    I updated the deprecated "OnDemand" key found in the old launch script, and set this to run every 5 minutes, in case something happens to the running instance of NR, or the first call to run the daemon fails. I set it to debug to a custom log file for testing, and it ran exactly as I wanted.

    Strangely enough, the check-nr script says NR isn't running, but whenever I manually start NR it shuts down after finding another instance.

    The plist goes in /Library/LaunchDaemons, and needs to be set to the permissions pictured here: http://screencast.com/t/vGBTdLX1NNlC

    It's also necessary to run `sudo launchctl load -w /Library/LaunchDaemons/com.netresponsibility.daemon.plist` in order to "register" the plist with launchd.

    I'll continue to test it and see how things work.

    Edit: This (apparently) works with OS X 10.8.4 Mountain Lion
  • That was fast :)

    I've created a new ticket #68 about adding it to the installation chain before the next release.

    If you're still interested in making a package of it, go for it!

    http://netresponsibility.com/documentation.php?id=5006-CreatingPackages
  • Great, thanks!

    Any idea why NR is sending out anywhere from 1 to 5 versions of the same report at one time?
  • No I haven't heard about it before... Is it from manual or scheduled reports? Are they identical to each other?
  • What's your output on `sudo net-responsibility --report`?
Sign In or Register to comment.