From World of VOC - Wiki
In general the SessionVOC compiler is called without any additional options
Changes the output filename, i.e. the name of generated shared object file, to arg instead of the default sessionvoc.so.
If this option is specified, then some information about the executed commands is printed.
The SessionVOC has a lot of options which allow you to adjust the server according to your needs. The most common options are
Command Line Options:
- --configuration: read configuration file
- --help: produce a usage message and exit
- --version: print version string and exit
- --session.description-file: descriptor file for the session
- --session.database-option: argument must be <identifier>,<name>,<value>
- --log.file: log to file (default: "+")
- --log.level: log level for severity 'human' (default: "info")
This option, when set, changes the working directory of the server to the directory specified. Note that this option is most useful when starting the server as a background process. The default working directory (when the server is started as a daemon) is /var/tmp.
-c [--configuration] arg
Specifies the name of the configuration file to use.
If this command is not passed to the SessionVOC, then by default, the server will attempt to first locate a file named ~/.sessionvoc/sessionvoc.conf in the user's home directory.
If no such file is found, the server will proceed to look for a file ./sessionvoc/sessionvoc.conf in the system configuration directory. The default installation specifies the system configuration directory as /etc. Therefore, in case that no configuration file is found in the user's home directory, the server will proceed to look for a file named /etc/sessionvoc.conf.
Only command line options with a value should be set within the configuration file. Command line options which act as flags should be entered on the command line when starting the Server.
White space is ignored. Each option is specified on a separate line in the form
- key = value
Alternatively, a header section can be specified and options pertaining to that section can be specified in a shorter form
- level = trace
rather than specifying
- log.level = trace
Comments can be placed in the configuration file, only if the line begins with one or more hash symbols (#).
There may be occasions where a configuration file exists and the user wishes to override configuration settings stored in a configuration file. Any settings specified on the command line will overwrite the same setting when it appears in a configuration file. If the user wishes to completely ignore configuration files without necessarily deleting the file (or files), then add the command line option
- -c none
- --configuration none
when starting up the server. Note that, the word none is case-insensitive.
Runs the SimpleVOC as a daemon (as a background process). This parameter can only be set if the pid (process id) file is specified. That is, unless a value to the parameter pid-file is given, then the server will report an error and exit.
The name (identity) of the group the server will run as. If this parameter is not specified, then the server will not attempt to change its GID, so that the GID the server runs as will be the primary group of the user who started the server. If this parameter is specified, then the server will change its GID after opening ports and reading configuration files, but before accepting connections or opening other files (such as recovery files).
This parameter is related to the parameter uid.
Prints a list of the most common options available and then exits. In order to see all options use --help-all.
The argument is an integer (1,2,3 or 4) which sets the manner in which random numbers are generated. The default method (3) is to use the a non-blocking random (or pseudorandom) number generator supplied by the operating system. Specifying an argument of 2, uses a blocking random (or pseudorandom) number generator. Specifying an argument 1 sets a pseudorandom number generator using an implication of the Mersenne Twister MT19937 algorithm. Algorithm 4 is a combination of the blocking random number generator and the Mersenne Twister.
By default, the random generator is seeded. Setting this option causes the random number generator not to be seeded. (Seeding the random number generator only occurs if the generator is set to Mersenne, refer to random.generator for details.)
The IO method used by the event handler. The default (if this option is not specified) is to try all recommended backends. This is platform specific. See libev for further details and the meaning of select, poll and epoll.
An integer argument which sets the number of threads to use in the IO scheduler. The default is 1.
If this option is specified, then the server will list available backends and exit. This option is useful only when used in conjunction with the option scheduler.backend. An integer is returned (which is platform dependent) which indicates available backends on your platform. See libev for further details and for the meaning of the integer returned. This describes the allowed integers for scheduler.backend.
Executes the server in supervisor mode. In the event that the server unexpectedly terminates due to an internal error, the supervisor will automatically restart the server. Setting this flag automatically implies that the server will run as a daemon. Note that, as with the daemon flag, this flag requires that the pid-file parameter will set.
The name (identity) of the user the server will run as. If this parameter is not specified, the server will not attempt to change its UID, so that the UID used by the server will be the same as the UID of the user who started the server. If this parameter is specified, then the server will change its UID after opening ports and reading configuration files, but before accepting connections or opening other files (such as recovery files). This is useful when the server must be started with raised privileges (in certain environments) but security considerations require that these privileges be dropped once the server has started work.
Observe that this parameter cannot be used to bypass operating system security. In general, this parameter (and its corresponding relative gid) can lower privileges but not raise them.
Prints the version of the SessionVOC and exits.
The session description file contains information about the database connections. You can modify these values by specifying <identifer,name,value, where identifier must match the identifier used in the session description, name is either
- db: the name of the database
- host: the database host
- user: the database user
- password: the database password
and value is the new value.
Specifies the shared object file generated by the SessionVOC compiler. This file contains the definition of the session data structure, databases to used, login procedures and timeouts. You must specify a valid description file.
These options are not available in the open edition of the SessionVOC.
External Trigger Options
These options are not available in the open edition of the SessionVOC.
Specifies the port on which the server listens for administrative requests. The arg should either be a port number or an address and port in the form address:port.
An integer argument which sets the number of file descriptors the server requires. If the operating system imposes a lower limit, the server will try to raise the limit. If this fails, the server exists with an fatal error.
The server logs a statistic about the scheduler and dispatcher queues every arg seconds.
The server will close any http connection unless the keep-alive flag is sent by the client.
When opening a listen port, the server will try to reuse the address.
Specifies the port on which the server listens for client requests. The arg must be an address and port in the form address:port.
There are two different kinds of logs. Human-readable logs and machine-readable logs. The human-readable logs are used to provide an administration with information about the server. The machine-readable logs are used to provide statistics about executed requests and timings about computation steps.
This option allows the user to specify the name of a file to which information is logged. By default, if no log file is specified, the standard output is used. Note that, if the file named by arg does not exist, it will be created. However, if the file already exists, output is appended to the file. Use + to log to standard error. Use "" to disable logging to file.
This parameter provides a set of standard log outputs which can be used. The current arguments accepted are:
The default is all.
If this option is set, then in addition to output being directed to the standard output (or to a specified file, in the case that the command line log.file option was set), log output is also sent to the system logging facility. The arg is the system log facility to use. See syslog for further details.
-l [--log.level] arg
Allows the user to choose the level of information which is logged by the server.
arg is specified as a string and can be one of the highlighted values listed
below. Note that, fatal errors, that is, errors which cause the server to terminate,
are always logged irrespective of the log level assigned by the user.
fatal — logs errors which cause the server to terminate.
Fatal errors generally indicate some inconsistency with the manner in which the server has been coded. Fatal errors may also indicate a problem with the platform on which the server is running. Fatal errors always cause the server to terminate. For example,
2010-09-20T07:32:12Z  FATAL a http server has already been created
error — logs errors which the server has encountered.
These errors may not necessarily result in the termination of the server. For example,
2010-09-17T13:10:22Z  ERROR strange log level 'errors', going to 'warning'
warning — provides information on errors encountered by the server, which are not necessarily detrimental to it's continued operation. For example,
2010-09-20T08:15:26Z  WARNING got corrupted HTTP request 'POS?'
Note that, setting the log level to warning will also result in all errors to be logged as well.
info — logs information about the status of the server. For example,
2010-09-20T07:40:38Z  INFO SimpleVOC ready for business
Note that, setting the log level to info will also result in all errors and warnings to be logged as well.
debug — logs all errors, all warnings and debug information.
Debug log information is generally useful to find out the state of the server in the case of an error. For example,
2010-09-17T13:02:53Z  DEBUG (ApplicationServer/ApplicationServerImpl.cpp:1200) opened port 7000 for any
Note that, setting the log level to debug will also result in all errors, warnings and server status information to be logged as well.
trace — as the name suggests, logs information which may be useful to trace problems encountered with using the server. For example,
2010-09-20T08:23:12Z  TRACE (ApplicationServer/ApplicationServerImpl.cpp:1088) trying to open port 8000 for http requests, token = '0'
Note that, setting the log level to trace will also result in all errors, warnings, status information, and debug information to be logged as well.
Normally, if an human readable fatal, error, warning or info message is logged, no information about the file and line number is provided. The file and line number is only logged for debug and trace message. This option can be use to always log these pieces of information.
This option is used specify an prefix to logged text.
Whenever log output is generated, the process ID is written as part of the log information. Setting this option appends the thread id of the calling thread to the process id. For example,
2010-09-20T13:04:01Z  INFO SimpleVOC ready for business 2010-09-20T13:04:01Z  INFO VOC version 1.6.1 (6734:6766)
when no thread is logged and
2010-09-20T13:04:17Z [19371-18446744072487317056] INFO SimpleVOC ready for business 2010-09-20T13:04:17Z [19371-18446744072487317056] INFO VOC version 1.6.1 (6734:6766)
when this command line option is set.
Specifies the name of the application which should be logged if this item of information is to be logged.
Also see log.format.
Specifies the name of the server instance which should be logged if this item of information is to be logged.
Also see log.format.
If the log output is machine (or machine readable), then this parameter allows you to configure the format of the output. The following placeholders are available:
%A the application name
%C the category which caused the output (e.g. FATAL, ERROR, WARNING etc.)
%H the host name to log
%T date/time stamp
%Z date/time stamp in GMT (zulu)
%f source code module
%l source code line
%m source code method
%s pthread identifier
%u user identifier
%x the actual text
Here is an example of an output for tracing a problem:
Specifies the name of the operating environment (the "hostname") which should be logged if this item of information is to be logged. Note that there is no default hostname.
Also see log.format.