Name | Modified | Size | Downloads / Week |
---|---|---|---|
server-framework-2.3.tar.gz | 2012-07-22 | 162.6 kB | |
README | 2012-07-22 | 2.6 kB | |
server-framework-1.1.tar.gz | 2012-05-02 | 113.2 kB | |
server-framework-1.0.tar.gz | 2012-05-02 | 113.1 kB | |
COPYING | 2012-04-29 | 756 Bytes | |
Totals: 5 Items | 392.3 kB | 0 |
Copyright (c) 2012, Martin Crossley <mjcross@users.sf.net> The accompanying application is free software. Please see the file COPYING for licence and disclaimers. The application is a general-purpose 'skeleton' for a Unix server daemon. As it stands it implements a very basic functionality; the idea is that you should use modify and extend it to implement your own server. Basic common command line options are already included, allowing the user to force the server to remain foreground, run as a different UID/GID etc. **NOTE** This version (2.3) includes a configuration file parser to show how to allow the end user to determine at runtime how the server operates. The configuration file parser is written using FLEX and YACC (or BISON) and lives in src/config_file_parser. It is fairly easy to adjust it to add new variables to the configuration file, even if you are not particularly familiar with FLEX and YACC. In the next week or two I will add a HowTo to the project that shows how to do that. To show what the configuration file should look like, an example is included as src/set.txt - to try the server 'out of the box', try this command line: $ cd src $ ./server-framework -dV9 -c set.txt --pidfile ./server-framework.pid (-d means remain foreground, -V9 means maximum verbosity, -c <path> defines where to find the config file, etc). ******** The framework is implemented as a GNU autotools project so to test it out of the box you should be able to just run "configure" and "make". If everything worked you should find an executable in the 'src' subdirectory. Try something like "server-framework --help". Then try running the server in the foreground with full debug messages enabled. It should produce something like this: $ ./server-framework -dV9 --pidfile ./pid creating PID file ./pid creating worker process worker process created (12633) supervisor installing signal handlers supervisor waiting worker dropping privileges to UID 1000, GID 1000 UID and GID match current user - no need to drop privileges worker alive worker alive worker alive worker alive worker alive [user hits ^C] supervisor caught signal: Interrupt supervisor waiting for worker process to finish supervisor terminating deleting PID file server exited $ If you run it without the -d option then after the server has successfully started up it should detach and log using syslog instead. Now stop reading this, and go and make it do something useful... Happy hacking! MC 29 April 2012 --- this application was developed with Eclipse Indigo under Ubuntu Linux. ---