README 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. $Id: README,v 1.3 2007/11/21 00:09:10 adamcain Exp $
  2. nrappkit 1.0b2
  3. Copyright (C) 2006 Network Resonance, Inc.
  4. nrappkit is a toolkit for building standalone applications and
  5. appliances. It provides:
  6. - registry-based configuration (with change callbacks)
  7. - extensible command and configuration shell
  8. - extensible statistics system
  9. - configurable logging system
  10. - event and timer handling
  11. - generic plugin system
  12. - launcher daemon
  13. The contents of nrappkit were extracted from Network Resonance's
  14. product on the theory that they were generally useful for
  15. application developers.
  16. THIS PACKAGE DOES NOT GRANT A LICENSE OR RIGHT TO ANY OTHER NETWORK
  17. RESONANCE TECHNOLOGY OR SOFTWARE.
  18. BUILDING
  19. Builds are done semi-manually with port directories for each
  20. platform. There are pre-existing ports to FreeBSD, Linux (Ubuntu
  21. and Fedora Core), and Darwin (MacOSX). To build the system:
  22. cd src/make/<platform>
  23. gmake
  24. Some of the platforms come in several variants. Most notably,
  25. if a platform exists in "regular" and "-appliance" variant,
  26. this means that the regular variant just builds binaries intended
  27. to be run out of the make directory (for development) and the
  28. appliance variant is intended to be installed in a real system.
  29. By default we want to install things owned as user "pcecap".
  30. Either make this user or edit the Makefile to be a user you
  31. like (e.g., nobody).
  32. If you want to include the 'nrsh' command-line configuration
  33. tool in your build, you will need to make sure the line
  34. BUILD_NRSH=yes
  35. appears (uncommented-out) in your platform Makefile. You will
  36. also need to to build OpenSSL and libedit and point your nrappkit
  37. Makefile to the correct paths. You can obtain these packages at:
  38. openssl-0.9.7l
  39. http://www.openssl.org/source/openssl-0.9.7l.tar.gz
  40. libedit-20060829-2.9
  41. http://freshmeat.net/redir/editline/53029/url_tgz/libedit-20060829-2.9.tar.gz
  42. INSTALLING
  43. If you're doing an appliance as opposed to a development build,
  44. you'll want to install it. This is easy:
  45. su
  46. gmake install
  47. Most binaries and libraries ends up in /usr/local/pcecap while
  48. data files are in /var/pcecap. However, you can tweak
  49. this in the Makefile. By default it's all owned by pcecap.
  50. To ensure that dynamic libraries are loaded correctly at runtime,
  51. you'd want to make sure the right directory is included in your
  52. LD_LIBRARY_PATH or via ldconfig.
  53. QUICK TOUR
  54. The build makes the following binaries that you may find useful:
  55. - captured -- the launcher (the name is historical)
  56. - registryd -- the registry daemon
  57. - nrregctl -- a registry control program
  58. - nrsh -- the command shell (when included in build)
  59. - nrstatsctl -- the stats control program
  60. Using the nrcapctl script is the easiest way to interact with
  61. the applications. It is run as "nrcapctl <command>" with the
  62. following commands recognized:
  63. startup -- fires up captured, which in turn runs and
  64. initializes the registry
  65. shutdown -- kills captured and its child processes
  66. status -- prints the running status of captured in
  67. human-readable form
  68. stat -- prints the running status of captured in
  69. a form easily parsed by scripts
  70. enable -- alters the mode.txt file so that captured
  71. starts
  72. disable -- alters the mode.txt file so that captured
  73. does not start
  74. clear-statistics -- equivalent to "nrstatsctl -z" (requires
  75. that captured be running)
  76. Note: the "start" and "stop" nrcapctl commands do nothing as they
  77. use components not included in nrappkit. However the associated
  78. script logic in nrcapctl demonstrates how additional applications
  79. might be launched using nrcapctl and particular registry settings.
  80. EXTENDING
  81. When things come up, they're pretty dumb. You'll probably want to
  82. write your own applications, otherwise it's not clear why you're doing
  83. this. The general idea is that you write your application using the
  84. facilities that nrappkit provides and then write plugins to the
  85. nrappkit components as necessary. So, for example, say you want
  86. to write a network daemon. You would:
  87. - configure the launcher to launch your daemon (using the registry,
  88. naturally).
  89. - make calls to the registry to get configuration data
  90. - make calls to the logging system to log data
  91. - implement a stats module to record statistics
  92. - write a plugin to nrsh to let people configure your parameters
  93. Examples of some of this stuff can be found in examples/demo_plugin.
  94. Otherwise, read the source. More documentation will be on the way,
  95. hopefully.