<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">


<refentry id="gfservice-agent.1">

<refentryinfo><date>6 Jun 2013</date></refentryinfo>

<refmeta>
<refentrytitle>gfservice-agent</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Gfarm</refmiscinfo>
</refmeta>

<refnamediv id="name">
<refname>gfservice-agent</refname>
<refpurpose>agent of <command moreinfo="none">gfservice</command></refpurpose>
</refnamediv>

<refsynopsisdiv id="synopsis">
<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfservice-agent</command>
    <arg choice="opt" rep="norepeat"><replaceable>options</replaceable></arg>
    <arg choice="plain" rep="norepeat">host-id</arg>
    <arg choice="plain" rep="norepeat">sub-command</arg>
    <arg choice="opt" rep="norepeat"><replaceable>argument ...</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<!-- body begins here -->

<refsect1 id="description"><title>DESCRIPTION</title>

<para>
<command moreinfo="none">gfservice-agent</command> is an agent of
<command moreinfo="none">gfservice</command>.
It must be installed on all hosts you want to operate using
<command moreinfo="none">gfservice</command>.
Unlike <command moreinfo="none">gfservice</command>, it doesn't read a configuration file.
</para>

<para>
<command moreinfo="none">gfservice-agent</command> is not designed to be executed
directly by an user.
In daily use, it is executed only by <command moreinfo="none">gfservice</command> via SSH
and Sudo.
</para>

<para>
Host-id argument is the same as that of <command moreinfo="none">gfservice</command>, but
<command moreinfo="none">gfservice-agent</command> uses host-id for recognizing type of
host ("gfmd", "gfsd" or "client") and debug messages only.
</para>

<para>
Sub-command names of <command moreinfo="none">gfservice-agent</command> are similar to
those of <command moreinfo="none">gfservice</command>, but their arguments are different.
For example, <command moreinfo="none">"unmount"</command> sub-command of
<command moreinfo="none">gfservice-agent</command> takes
<parameter moreinfo="none">"directory=<replaceable>directory</replaceable>"</parameter>
argument:
</para>

<literallayout format="linespecific" class="normal">
	gfservice-agent client3 unmount directory=/somewhere
</literallayout>

<para>
while <command moreinfo="none">"unmount"</command> sub-command of <command moreinfo="none">gfservice</command>
takes <replaceable>"directory"</replaceable> argument:
</para>

<literallayout format="linespecific" class="normal">
	gfservice unmount client3 /somewhere
</literallayout>

<para>
Almost all arguments of <command moreinfo="none">gfservice-agent</command> have "key=value"
form.
When two or more arguments are given, <command moreinfo="none">gfservice-agent</command>
doesn't care about the order of arguments.
<command moreinfo="none">gfservice-agent</command> ignores arguments with unknown keys.
</para>

</refsect1>

<refsect1 id="options"><title>OPTIONS</title>

<variablelist>

<varlistentry>
<term><option>-d</option></term>
<listitem>
<para>
Print debug information.
</para>
</listitem>
</varlistentry>

</variablelist>

</refsect1>

<refsect1 id="sub-commands"><title>SUB-COMMANDS</title>

<para>
<command moreinfo="none">gfservice-agent</command> currently recognizes the following
sub-commands.
</para>

<variablelist>

<varlistentry>
<term>
<command moreinfo="none">get-config-gfarm-param</command>
<parameter moreinfo="none">param</parameter>=<replaceable>name</replaceable>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">config-gfarm -T</command> command and output a value of
the parameter <replaceable>name</replaceable> to standard out.
If the "<parameter moreinfo="none">param</parameter>=<replaceable>name</replaceable>"
argument is not specified, it outputs entire
<command moreinfo="none">config-gfarm -T</command> results.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">get-config-gfsd-param</command>
<parameter moreinfo="none">param</parameter>=<replaceable>name</replaceable>
<parameter moreinfo="none">config-gfsd-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">config-gfsd -T</command> command and output a value of
the parameter <replaceable>name</replaceable> to standard out.
If the "<parameter moreinfo="none">param</parameter>=<replaceable>name</replaceable>"
argument is not specified, it outputs entire
<command moreinfo="none">config-gfsd -T</command> results.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backend-db-status</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Exit with an exit code 0, if a backend database is currently running.
Otherwise exits with 1.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">gfmd-status</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Exit with an exit code 0, if gfmd is currently running.
Otherwise exits with 1.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">gfsd-status</command>
<parameter moreinfo="none">config-gfsd-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Exit with an exit code 0, if gfsd is currently running.
Otherwise exits with 1.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">start-backend-db</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
<parameter moreinfo="none">timeout</parameter>=<replaceable>time</replaceable>
</term>
<listitem>
<para>
Start a backend database if it is not running currently.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">start-gfmd</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
<parameter moreinfo="none">timeout</parameter>=<replaceable>time</replaceable>
</term>
<listitem>
<para>
Start gfmd if it is not running currently.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">start-gfsd</command>
<parameter moreinfo="none">config-gfsd-options</parameter>=<replaceable>options</replaceable>
<parameter moreinfo="none">timeout</parameter>=<replaceable>time</replaceable>
</term>
<listitem>
<para>
Start gfsd if it is not running currently.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">config-gfarm</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">config-gfarm</command> command.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">config-gfarm-master</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">config-gfarm</command> <parameter moreinfo="none">-r</parameter> command.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">config-gfsd</command>
<parameter moreinfo="none">config-gfsd-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">config-gfsd</command> command.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unconfig-gfarm</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">stop-gfarm</command> sub-command and then delete all
files and directories created by gfmd and a backend database.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unconfig-gfsd</command>
<parameter moreinfo="none">config-gfsd-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Execute <command moreinfo="none">stop-gfsd</command> sub-command and then delete all
files and directories created by gfsd.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unconfig-client</command>
<parameter moreinfo="none">config-gfsd-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Delete <filename moreinfo="none">gfarm2.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">promote</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Promote <command moreinfo="none">gfmd</command> from a slave to a master.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">promote-gfmd</command>
<parameter moreinfo="none">config-gfarm-options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
An alias of <command moreinfo="none">promote</command> sub-command.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">mount</command>
<parameter moreinfo="none">directory</parameter>=<replaceable>directory</replaceable>
<parameter moreinfo="none">options</parameter>=<replaceable>options</replaceable>
</term>
<listitem>
<para>
Mount a Gfarm2 filesystem on <replaceable>directory</replaceable>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unmount</command>
<parameter moreinfo="none">directory</parameter>=<replaceable>directory</replaceable>
</term>
<listitem>
<para>
Unmount a Gfarm2 filesystem currently mounted on
<replaceable>directory</replaceable>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">umount</command>
<parameter moreinfo="none">directory</parameter>=<replaceable>directory</replaceable>
</term>
<listitem>
<para>
An alias of <command moreinfo="none">unmount</command> sub-command.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">set-gfmd-conf</command>
<parameter moreinfo="none">directive</parameter>=<replaceable>name</replaceable>
<parameter moreinfo="none">value</parameter>=<replaceable>value</replaceable>
</term>
<listitem>
<para>
Add
</para>

<literallayout format="linespecific" class="normal">
	<replaceable>directive</replaceable> <replaceable>value</replaceable>
</literallayout>

<para>
line to <filename moreinfo="none">gfmd.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">set-gfarm-conf</command>
<parameter moreinfo="none">directive</parameter>=<replaceable>name</replaceable>
<parameter moreinfo="none">value</parameter>=<replaceable>value</replaceable>
</term>
<listitem>
<para>
Add
</para>

<literallayout format="linespecific" class="normal">
	<replaceable>directive</replaceable> <replaceable>value</replaceable>
</literallayout>

<para>
line to <filename moreinfo="none">gfarm2.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">set-gfsd-conf</command>
<parameter moreinfo="none">directive</parameter>=<replaceable>name</replaceable>
<parameter moreinfo="none">value</parameter>=<replaceable>value</replaceable>
</term>
<listitem>
<para>
Add
</para>

<literallayout format="linespecific" class="normal">
	<replaceable>directive</replaceable> <replaceable>value</replaceable>
</literallayout>

<para>
line to <filename moreinfo="none">gfsd.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unset-gfmd-conf</command>
<parameter moreinfo="none">directive</parameter>=<replaceable>name</replaceable>
</term>
<listitem>
<para>
Delete a <replaceable>directive</replaceable> line in
<filename moreinfo="none">gfmd.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unset-gfarm-conf</command>
<parameter moreinfo="none">directive</parameter>=<replaceable>name</replaceable>
</term>
<listitem>
<para>
Delete a <replaceable>directive</replaceable> line in
<filename moreinfo="none">gfarm2.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">unset-gfsd-conf</command>
<parameter moreinfo="none">directive</parameter>=<replaceable>name</replaceable>
</term>
<listitem>
<para>
Delete a <replaceable>directive</replaceable> line in
<filename moreinfo="none">gfsd.conf</filename> file.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backup-backend-db</command>
</term>
<listitem>
<para>
Backup a backend database and output the backup data to standard out.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backup-gfmd-conf</command>
</term>
<listitem>
<para>
Output <filename moreinfo="none">gfmd.conf</filename> file to standard out.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backup-gfarm-conf</command>
</term>
<listitem>
<para>
Output <filename moreinfo="none">gfarm2.conf</filename> file to standard out.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backup-gfsd-conf</command>
</term>
<listitem>
<para>
Output <filename moreinfo="none">gfsd.conf</filename> file to standard out.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backup-usermap</command>
</term>
<listitem>
<para>
Output <filename moreinfo="none">usermap</filename> file to standard out.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">backup-shared-key</command>
</term>
<listitem>
<para>
Output <filename moreinfo="none">$HOME/.gfarm_shared_key</filename> file to standard out.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">restore-backend-db</command>
</term>
<listitem>
<para>
Restore a backend database.
The backup data are read from standard in.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">restore-gfmd-conf</command>
</term>
<listitem>
<para>
Restore <filename moreinfo="none">gfmd.conf</filename> file.
The backup data are read from standard in.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">restore-gfarm-conf</command>
</term>
<listitem>
<para>
Restore <filename moreinfo="none">gfarm2.conf</filename> file.
The backup data are read from standard in.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">restore-gfsd-conf</command>
</term>
<listitem>
<para>
Restore <filename moreinfo="none">gfsd.conf</filename> file.
The backup data are read from standard in.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">restore-usermap</command>
</term>
<listitem>
<para>
Restore <filename moreinfo="none">usermap</filename> file.
The backup data are read from standard in.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">restore-shared-key</command>
</term>
<listitem>
<para>
Restore <filename moreinfo="none">$HOME/.gfarm_shared_key</filename> file.
The backup data are read from standard in.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">gfcmd</command>
<parameter moreinfo="none">cmd</parameter>=<replaceable>command-name</replaceable>
<parameter moreinfo="none">args</parameter>="<replaceable>command-argument ...</replaceable>"
</term>
<listitem>
<para>
Execute a Gfarm command.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<command moreinfo="none">grid-proxy-init</command>
<parameter moreinfo="none">args</parameter>="<replaceable>command-argument ...</replaceable>"
</term>
<listitem>
<para>
Execute <command moreinfo="none">grid-proxy-init</command> command.
</para>
</listitem>
</varlistentry>

</variablelist>

</refsect1>

</refentry>
