1 #include "opensrf/osrf_system.h"
4 @brief Run an OSRF server as defined by the command line and a config file.
5 @param argc Number of command line arguments, plus one.
6 @param argv Ragged array of command name plus command line arguments.
7 @return 0 if successful, or 1 if failure.
9 Command line parameters:
10 - Full network name of the host where the process is running; or 'localhost' will do.
11 - Name of the configuration file; normally '/openils/conf/opensrf_core.xml'.
12 - Name of an aggregate within the configuration file, containing the relevant subset
13 of configuration stuff.
15 int main( int argc, char* argv[] ) {
18 fprintf(stderr, "Usage: %s <host> <bootstrap_config> <config_context>\n", argv[0]);
22 /* these must be strdup'ed because init_proc_title / set_proc_title
23 are evil and overwrite the argv memory */
24 char* host = strdup( argv[1] );
25 char* config = strdup( argv[2] );
26 char* context = strdup( argv[3] );
29 osrfSystemSetPidFile( argv[4] );
31 init_proc_title( argc, argv );
32 set_proc_title( "OpenSRF System-C" );
34 int ret = osrfSystemBootstrap( host, config, context );
39 "Server Loop returned an error condition, exiting with %d",