[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]


User service daemon and client specification
Chapter 4 - Service-side configuration


Which services may be run by whom and under what conditions is controlled by configuration files.

The daemon will read these files in order. Certain directives in the files modify the daemon's execution settings for invoking the service, for example allowing certain file descriptors to be specified by the client or specifying which program to execute to provide the service.

The last instance of each such setting will take effect. The directives which specify which program to execute will not stop the configuration file from being read; they will be remembered and will only take effect if they are not overridden by a later directive.

The daemon will first read /etc/userv/system.default. Then, by default (this behaviour may be modified), it will read a per-user file ~/.userv/rc, if it exists and the service user's shell is in /etc/shells. Finally it will read /etc/userv/system.override.

When it has read all of these files it will act according to the currently values of of the execution settings.


4.1 Configuration file syntax

The configuration file is a series of directives, usually one per line. The portion of a line following a hash character # is taken as a comment and ignored. Each directive consists of a series of tokens separated by linear whitespace (spaces and tabs); tokens may be words consisting of non-space characters, or, where a string is required, a string in double quotes. Double-quoted strings may contain the following backslash escapes:

\n

newline

\t

tab

\r

carriage return

\OOO

character whose octal code is OOO

\xXX

character whose hex code is XX

\punctuation

literal punctuation character (eg \\, \")

\newline (ie, backslash at end of line)

string continues on next line

Relative pathnames in directives are relative to the service program's current directory (usually the service user's home directory). Pathnames starting with the two characters ~/ are taken to be relative to the service user's home directory.


4.2 Configuration file directives


4.2.1 Immediate directives

The following directives take effect immediately:

cd pathname

Change directory in the service program. cd is cumulative. It is an error if the directory cannot be changed to.

cd should not be used between execute-from-directory and the invocation of the service program, as the test for the availability of the service program would be done with the old current directory and the actual execution with the new (probably causing an error).

eof

Stop reading the configuration file in question, as if end of file had been reached. Any control constructs (if, catch-quit or errors-push) which were started in that file will be considered finished. Parsing will continue in the file which caused the file containing the eof to be read.

quit

Stop reading configuration files and act immediately on the current settings. The behaviour of quit is subject to the catch-quit control construct.

include filename
include-ifexist filename

Read the configuration file filename, and then return to this file and continue parsing it with the next directive. It is an error if the file cannot be opened and read, unless include-ifexist is used and the file does not exist, in which case the directive is silently ignored.

include-lookup parameter directory
include-lookup-all parameter directory

Read the configuration file in directory whose name is the value of parameter (see the description of if, Control structure directives, Section 4.2.3). If parameter has several values they will be tried in order; with include-lookup this search will stop when one is found, but with include-lookup-all the search will continue and any files appropriate to other values will be read too.

If none of the parameter's values had a corresponding file then the file :default will be read, if it exists. If parameter's list of values was empty then the file :none will be tried first and read if it exists, otherwise :default will be tried.

It is not an error for any of the files (including :default) not to exist, but it is an error if a file exists and cannot be read or if the directory cannot be accessed.

A translation will be applied to values before they are used to construct a filename, so that the lookup cannot access dotfiles or files in other directories: values starting with full stops will have a colon prepended (making :.), colons will be doubled, and each slash will be replaced with a colon followed by a hyphen :-. A parameter value which is the empty string will be replaced with :empty (note that this is different from a parameter not having any values).

include-directory directory

Read configuration from all files in directory directory which are plain files whose names consist only of alphanumerics and hyphens and start with an alphanumeric. They will be read in lexical order. It is an error for the directory not to exist or for it or any of the files found not to be read successfully, or for anything with an appropriate name not to be a plain file or a symbolic link to a plain file.

error text ...

Causes an error whose message includes the descriptive string text. text may consist of several tokens with intervening whitespace. The whitespace will be included in the message as found in the configuration file: all the characters until the end of the line will be included verbatim, unless they are part of a double-quoted string, in which case the usual meaning of the string (i.e., after backslash escape processing) will be used. Comments and linear whitespace at the end of the line (or just before the comment) will still be ignored.

message text ...

Causes a message including the descriptive string text to be delivered as if it were an error message, but does not actually cause an error.


4.2.2 Directives with delayed effect

The following directives have no immediate effect, but are remembered and have an effect on later processing of the configuration files.

user-rcution settings">


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]


User service daemon and client specification
Chapter 4 - Service-side configuration


Which services may be run by whom and under what conditions is controlled by configuration files.

The daemon will read these files in order. Certain directives in the files modify the daemon's execution settings for invoking the service, for example allowing certain file descriptors to be specified by the client or specifying which program to execute to provide the service.

The last instance of each such setting will take effect. The directives which specify which program to execute will not stop the configuration file from being read; they will be remembered and will only take effect if they are not overridden by a later directive.

The daemon will first read /etc/userv/system.default. Then, by default (this behaviour may be modified), it will read a per-user file ~/.userv/rc, if it exists and the service user's shell is in /etc/shells. Finally it will read /etc/userv/system.override.

When it has read all of these files it will act according to the currently values of of the execution settings.


4.1 Configuration file syntax

The configuration file is a series of directives, usually one per line. The portion of a line following a hash character # is taken as a comment and ignored. Each directive consists of a series of tokens separated by linear whitespace (spaces and tabs); tokens may be words consisting of non-space characters, or, where a string is required, a string in double quotes. Double-quoted strings may contain the following backslash escapes:

\n

newline

\t

tab

\r

carriage return

\OOO

character whose octal code is OOO

\xXX

character whose hex code is XX

\punctuation

literal punctuation character (eg \\, \")

\newline (ie, backslash at end of line)

string continues on next line

Relative pathnames in directives are relative to the service program's current directory (usually the service user's home directory). Pathnames starting with the two characters ~/ are taken to be relative to the service user's home directory.


4.2 Configuration file directives


4.2.1 Immediate directives

The following directives take effect immediately:

cd pathname

Change directory in the service program. cd is cumulative. It is an error if the directory cannot be changed to.

cd should not be used between execute-from-directory and the invocation of the service program, as the test for the availability of the service program would be done with the old current directory and the actual execution with the new (probably causing an error).

eof

Stop reading the configuration file in question, as if end of file had been reached. Any control constructs (if, catch-quit or errors-push) which were started in that file will be considered finished. Parsing will continue in the file which caused the file containing the eof to be read.

quit

Stop reading configuration files and act immediately on the current settings. The behaviour of quit is subject to the catch-quit control construct.

include filename
include-ifexist filename

Read the configuration file filename, and then return to this file and continue parsing it with the next directive. It is an error if the file cannot be opened and read, unless include-ifexist is used and the file does not exist, in which case the directive is silently ignored.

include-lookup parameter directory
include-lookup-all parameter directory

Read the configuration file in directory whose name is the value of parameter (see the description of if, Control structure directives, Section 4.2.3). If parameter has several values they will be tried in order; with include-lookup this search will stop when one is found, but with include-lookup-all the search will continue and any files appropriate to other values will be read too.

If none of the parameter's values had a corresponding file then the file :default will be read, if it exists. If parameter's list of values was empty then the file :none will be tried first and read if it exists, otherwise :default will be tried.

It is not an error for any of the files (including :default) not to exist, but it is an error if a file exists and cannot be read or if the directory cannot be accessed.

A translation will be applied to values before they are used to construct a filename, so that the lookup cannot access dotfiles or files in other directories: values starting with full stops will have a colon prepended (making :.), colons will be doubled, and each slash will be replaced with a colon followed by a hyphen :-. A parameter value which is the empty string will be replaced with :empty (note that this is different from a parameter not having any values).

include-directory directory

Read configuration from all files in directory directory which are plain files whose names consist only of alphanumerics and hyphens and start with an alphanumeric. They will be read in lexical order. It is an error for the directory not to exist or for it or any of the files found not to be read successfully, or for anything with an appropriate name not to be a plain file or a symbolic link to a plain file.

error text ...

Causes an error whose message includes the descriptive string text. text may consist of several tokens with intervening whitespace. The whitespace will be included in the message as found in the configuration file: all the characters until the end of the line will be included verbatim, unless they are part of a double-quoted string, in which case the usual meaning of the string (i.e., after backslash escape processing) will be used. Comments and linear whitespace at the end of the line (or just before the comment) will still be ignored.

message text ...

Causes a message including the descriptive string text to be delivered as if it were an error message, but does not actually cause an error.


4.2.2 Directives with delayed effect

The following directives have no immediate effect, but are remembered and have an effect on later processing of the configuration files.

user-rcution settings">


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]


User service daemon and client specification
Chapter 4 - Service-side configuration


Which services may be run by whom and under what conditions is controlled by configuration files.

The daemon will read these files in order. Certain directives in the files modify the daemon's execution settings for invoking the service, for example allowing certain file descriptors to be specified by the client or specifying which program to execute to provide the service.

The last instance of each such setting will take effect. The directives which specify which program to execute will not stop the configuration file from being read; they will be remembered and will only take effect if they are not overridden by a later directive.

The daemon will first read /etc/userv/system.default. Then, by default (this behaviour may be modified), it will read a per-user file ~/.userv/rc, if it exists and the service user's shell is in /etc/shells. Finally it will read /etc/userv/system.override.

When it has read all of these files it will act according to the currently values of of the execution settings.


4.1 Configuration file syntax

The configuration file is a series of directives, usually one per line. The portion of a line following a hash character # is taken as a comment and ignored. Each directive consists of a series of tokens separated by linear whitespace (spaces and tabs); tokens may be words consisting of non-space characters, or, where a string is required, a string in double quotes. Double-quoted strings may contain the following backslash escapes:

\n

newline

\t

tab

\r

carriage return

\OOO

character whose octal code is OOO

\xXX

character whose hex code is XX

\punctuation

literal punctuation character (eg \\, \")

\newline (ie, backslash at end of line)

string continues on next line

Relative pathnames in directives are relative to the service program's current directory (usually the service user's home directory). Pathnames starting with the two characters ~/ are taken to be relative to the service user's home directory.


4.2 Configuration file directives


4.2.1 Immediate directives

The following directives take effect immediately:

cd pathname

Change directory in the service program. cd is cumulative. It is an error if the directory cannot be changed to.

cd should not be used between execute-from-directory and the invocation of the service program, as the test for the availability of the service program would be done with the old current directory and the actual execution with the new (probably causing an error).

eof

Stop reading the configuration file in question, as if end of file had been reached. Any control constructs (if, catch-quit or errors-push) which were started in that file will be considered finished. Parsing will continue in the file which caused the file containing the eof to be read.

quit

Stop reading configuration files and act immediately on the current settings. The behaviour of quit is subject to the catch-quit control construct.

include filename
include-ifexist filename

Read the configuration file filename, and then return to this file and continue parsing it with the next directive. It is an error if the file cannot be opened and read, unless include-ifexist is used and the file does not exist, in which case the directive is silently ignored.

include-lookup parameter directory
include-lookup-all parameter directory

Read the configuration file in directory whose name is the value of parameter (see the description of if, Control structure directives, Section 4.2.3). If parameter has several values they will be tried in order; with include-lookup this search will stop when one is found, but with include-lookup-all the search will continue and any files appropriate to other values will be read too.

If none of the parameter's values had a corresponding file then the file :default will be read, if it exists. If parameter's list of values was empty then the file :none will be tried first and read if it exists, otherwise :default will be tried.

It is not an error for any of the files (including :default) not to exist, but it is an error if a file exists and cannot be read or if the directory cannot be accessed.

A translation will be applied to values before they are used to construct a filename, so that the lookup cannot access dotfiles or files in other directories: values starting with full stops will have a colon prepended (making :.), colons will be doubled, and each slash will be replaced with a colon followed by a hyphen :-. A parameter value which is the empty string will be replaced with :empty (note that this is different from a parameter not having any values).

include-directory directory

Read configuration from all files in directory directory which are plain files whose names consist only of alphanumerics and hyphens and start with an alphanumeric. They will be read in lexical order. It is an error for the directory not to exist or for it or any of the files found not to be read successfully, or for anything with an appropriate name not to be a plain file or a symbolic link to a plain file.

error text ...

Causes an error whose message includes the descriptive string text. text may consist of several tokens with intervening whitespace. The whitespace will be included in the message as found in the configuration file: all the characters until the end of the line will be included verbatim, unless they are part of a double-quoted string, in which case the usual meaning of the string (i.e., after backslash escape processing) will be used. Comments and linear whitespace at the end of the line (or just before the comment) will still be ignored.

message text ...

Causes a message including the descriptive string text to be delivered as if it were an error message, but does not actually cause an error.


4.2.2 Directives with delayed effect

The following directives have no immediate effect, but are remembered and have an effect on later processing of the configuration files.

user-rcution settings">


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]


User service daemon and client specification
Chapter 4 - Service-side configuration


Which services may be run by whom and under what conditions is controlled by configuration files.

The daemon will read these files in order. Certain directives in the files modify the daemon's execution settings for invoking the service, for example allowing certain file descriptors to be specified by the client or specifying which program to execute to provide the service.

The last instance of each such setting will take effect. The directives which specify which program to execute will not stop the configuration file from being read; they will be remembered and will only take effect if they are not overridden by a later directive.

The daemon will first read /etc/userv/system.default. Then, by default (this behaviour may be modified), it will read a per-user file ~/.userv/rc, if it exists and the service user's shell is in /etc/shells. Finally it will read /etc/userv/system.override.

When it has read