## Name

gfservice.conf — configuration file of gfservice

## DESCRIPTION

gfservice reads configuration data from the file. (gfservice-agent doesn't read a configuration file.)

The configuration file itself is a Bourne-shell script. It is evaluated as a script by gfservice. Here is an example of the configuration file:

# gfmd entries.
gfmd1=db1.example.com
gfmd2=db2.example.com

Same as Bourne-shell script, lines beginning with '#' and empty lines are ignored. The other lines declare shell variables. In this example, the variable `gfmd1` is set to `db1.example.com` and `gfmd2` to `db12.example.com` respectively. Whitespaces must not be inserted around '='.

The variables named `gfmd1` and `gfmd2` are used as "host-id". To specify a remote host, gfservice uses host-id instead of hostname:

gfservice `start-gfmd` `gfmd2`

Executing the command, gfservice starts gfmd on `gfmd2` server, metadb2.example.com. Note that the numbers at the tails of host-ids must be beginning with 1 and must be assigned successively.

For specifying gfsd servers and client hosts, use host-ids "gfs`n`" and "client`n`" respectively:

# gfsd entries.
gfsd1=fs1.example.com
# client entries
client1=pc1.example.com
client2=pc2.example.com
client3=pc2.example.com

In addition with host-id variables, gfservice recognizes some variables related to host-id.

# Configuration about gfmd1.
gfmd1_CONFIG_GFARM_OPTIONS="-X -A $LOGNAME"
gfmd1_SSH="ssh -i $HOME/.ssh/id_rsa_gfservice"
gfmd1_SUDO=/usr/local/bin/sudo

As shown in this example, a value containing whitespaces can be set by quotation marks. `$VARNAME` is expanded to the value of the shell or environment variable `VARNAME`.

## VARIABLES ABOUT GFMD

Variables named "gfmd`n`" (gfmd1, gfmd2, ...) define gfmd servers. Variable names beginning with "gfmd`n`_" such as `gfmd1_SSH` set configuration parameters of the corresponding "gfmd`n`" server. gfservice currently the following variables:

`gfmd`n``

  Register a gfmd server. Its value represents a hostname (or an IP address) of the server. Note that gfservice uses the values for destination hosts of SSH connections only. To specify host names used in the Gfarm system, use `-h` option in `gfmd`n`_CONFIG_GFARM_OPTOINS` variable instead:

  gfmd1=md1-ctl.example.org
  gfmd1_CONFIG_GFARM_OPTIONS="-h md1.example.org"

`gfmd`n`_GFBINDIR`

  Specify a path to a directory where gfservice-agent command is installed on the gfmd server. If the variable is declared, gfservice executes "`$gfmd`n`_GFBINDIR`/gfservice-agent". Otherwise it executes "gfservice-agent".

`gfmd`n`_CONFIG_GFARM_OPTIONS`

  Specify options of config-gfarm command. The default value is empty (no option). gfservice refers this variable to perform config-gfarm and many other sub-commands. Do not delete or edit the declaration even after config-gfarm has been complete.

`gfmd`n`_PRIVATE_MODE`

  Set this variable to "true" if gfmd on the remote host is configured in private mode.

`gfmd`n`_AUTH_TYPE`

  Specify authentication type ("sharedsecret", "gsi" or "gsi_auth"). If the variable is not declared, its value is chosen from `AUTH_TYPE` value output by config-gfarm -T command executed on gfmd1. (Note that the value `AUTH_TYPE` above is affected by the variable `gfmd1_CONFIG_GFARM_OPTIONS`.)

`gfmd`n`_CLUSTER_NAME`

  Specify a cluster name of the gfmd server. The default value is "" (empty) which means the server belongs to the default cluster.

`gfmd`n`_SSH`

  Specify a path to an SSH client command and its options. The variable is used when gfservice executes an SSH client command to connect with the gfsd server. The default value is "ssh".

`gfmd`n`_SUDO`

  Specify a path to a Sudo command and options. The variable is used when gfservice executes a Sudo command on the gfsd server via SSH. The default value is "sudo".

## VARIABLES ABOUT GFSD

Variables named "gfsd`n`" (gfsd1, gfsd2, ...) define gfsd servers. Variable names beginning with "gfsd`n`_" such as `gfsd1_SSH` set configuration parameters of the corresponding "gfsd`n`" server. gfservice currently recognizes the following variables:

`gfsd`n``

  Register a gfsd server. Its value represents a hostname (or an IP address) of the server. Note that gfservice uses the values for destination hosts of SSH connections only. To specify host names used in the Gfarm system, use `-h` option in `gfsd`n`_CONFIG_GFSD_OPTOINS` variable instead:

  gfsd1=fs2-ctl.example.org
  gfsd1_CONFIG_GFSD_OPTIONS="-h fs2.example.org"

`gfsd`n`_GFBINDIR`

  Specify a path to a directory where gfservice-agent command is installed on the gfsd server. If the variable is declared, gfservice executes "`$gfsd`n`_GFBINDIR`/gfservice-agent". Otherwise it executes "gfservice-agent".

`gfsd`n`_CONFIG_GFSD_OPTIONS`

  Specify options of config-gfsd command. The default value is empty (no option). gfservice refers this variable to perform config-gfsd and many other sub-commands. Do not delete or edit the declaration even after config-gfsd has been complete.

`gfsd`n`_PRIVATE_MODE`

  Set this variable to "true" if gfsd on the remote host is configured in private mode.

`gfsd`n`_AUTH_TYPE`

  Specify authentication type ("sharedsecret", "gsi" or "gsi_auth"). If the variable is not declared, its value is chosen from `AUTH_TYPE` value output by config-gfarm -T command executed on gfmd1. (Note that the value `AUTH_TYPE` above is affected by the variable `gfmd1_CONFIG_GFARM_OPTIONS`.)

`gfsd`n`_SSH`

  Specify a path to an SSH client command and its options. The variable is used when gfservice executes an SSH client command to connect with the gfsd server. The default value is "ssh".

`gfsd`n`_SUDO`

  Specify a path to a Sudo command and options. The variable is used when gfservice executes a Sudo command on the gfsd server via SSH. The default value is "sudo".

## VARIABLES ABOUT CLIENT

Variables named "client`n`" (client1, client2, ...) define client hosts. Their values are hostnames (or IP addresses). Variable names beginning with "client`n`_" such as `client1_SUDO` set configuration parameters of the corresponding "client`n`" host. gfservice currently recognizes the following variables:

`client`n``

  Register a client host. Its value represents a hostname (or an IP address) of the host.

`client`n`_GFBINDIR`

  Specify a path to a directory where gfservice-agent command is installed on the client host. If the variable is declared, gfservice executes "`$client`n`_GFBINDIR`/gfservice-agent". Otherwise it executes "gfservice-agent".

`client`n`_MOUNT_GFARM2FS`

  Specify a path to mount.gfarm2fs command and its options. The variable is used when gfservice executes mount.gfarm2fs command to mount a file system. The default value is "%%BINDIR%%/mount.gfarm2fs".

`client`n`_UMOUNT_GFARM2FS`

  Specify a path to umount.gfarm2fs command and its options. The variable is used when gfservice executes umount.gfarm2fs command to unmount a file system. The default value is "%%BINDIR%%/umount.gfarm2fs".

`client`n`_SSH`

  Specify a path to an SSH client command and its options. The variable is used when gfservice executes an SSH client command to connect with the client host. The default value is "ssh".

`client`n`_SUDO`

  Specify a path to a Sudo command and options. The variable is used when gfservice executes a Sudo command on the client host via SSH. The default value is "sudo".

`client`n`_GFARM_CONF`

  Specify a gfarm2.conf file in absolute path. If a value is not set, gfservice uses a same path as the path of gfarm2.conf in gfmd1(determined from the 'gfmd1_CONFIG_GFARM_OPTIONS' shell variable).

`client`n`_PRIVATE_MODE`

  If this variable is set to "true", gfservice processes the sub-command config-client without root privilege.

`client`n`_AUTH_TYPE`

  Specify authentication type ("sharedsecret", "gsi" or "gsi_auth"). If the variable is not declared, its value is chosen from `AUTH_TYPE` value output by config-gfarm -T command executed on gfmd1. (Note that the value `AUTH_TYPE` above is affected by the variable `gfmd1_CONFIG_GFARM_OPTIONS`.)