GFSERVICE(1)
GFSERVICE(1) π
okay bestie, welcome to the Gfarm corner of the manual universe β this is gfservice, and she is that girl. β¨
β¨ NAME β¨
gfservice β control Gfarm servers from a remote host π«Ά
β¨ SYNOPSIS β¨
gfservice [options] sub-command [host-id] [argument ...]
β¨ DESCRIPTION β¨
so basically, gfservice is the little utility Gfarm admins use to boss around servers (gfmd, gfsd and PostgreSQL) on remote hosts. OpenLDAP is not supported currently β like, she's just not doing that rn, okay? π
what she can do: start, stop, set up (she runs config-gfarm and config-gfsd for you) and clean up the servers. lowkey iconic, highkey useful. π
a sample command line looks like this:
gfservice start-gfmd gfmd2
where start-gfmd is a sub-command and gfmd2 is a host-id respectively. so when you run that, gfservice tries to start gfmd on the host named gfmd2. to point at a remote server host, gfservice uses a host-id instead of a hostname β yes bestie, they're different things, keep up π
.
all the host-ids (gfmd1, gfmd2, and so on) live in a configuration file of gfservice. here's a lil example of that configuration file:
gfmd1=metadb1.example.com
gfmd1_CONFIG_GFARM_OPTIONS="-A $LOGNAME -X"
gfmd2=metadb2.example.com
gfmd2_CONFIG_GFARM_OPTIONS="-A $LOGNAME -X"
gfsd1=spool1.example.com
gfsd2=spool2.example.com
now, how does gfservice decide which config file to read? she follows these procedures, in order:
- if the
-f fileoption is specified, she reads thatfile. periodt. - otherwise, if the environment variable
GFSERVICE_CONFis defined and not empty, she reads that file. - otherwise, she reads
$HOME/.gfservice.
if gfservice fails to read a configuration file, she prints an error message and exits immediately β no vibes, no waiting. π
β οΈ heads up: the configuration file itself is a Bourne-shell script, andgfserviceincludes (exactly to say, evaluates) the file. so likeβ¦ she's running it, bestie. seegfservice.conf(5)for more details about the configuration file.
gfservice uses SSH (Secure Shell) to connect with a remote host. and since she may execute ssh several times during a sub-command operation, it is recommended to use an SSH agent (e.g. ssh-agent of OpenSSH) or an authentication key with an empty passphrase, so you're not typing your passphrase every single time. imagine. π
in addition to SSH, gfservice uses Sudo to get root privilege on the remote host. please add a line like the one below to the sudoers file (Sudo's configuration file) on each remote host:
user ALL=(root, _gfarmfs, _gfarmmd) NOPASSWD: gfservice-agent
where user is an user name who executes gfservice. the NOPASSWD option is not mandatory, but sudo may ask you for a password several times if you omit it. (and by "may" we mean "will", and by "several" we mean "you will be typing forever". π)
since gfservice executes an agent command named gfservice-agent on the remote host using SSH and Sudo, the gfservice-agent command must have been installed on all hosts you want to operate using gfservice. no agent, no service, that's the rule. πΈ
oh and β gfservice has a plug-in system so that user can add new sub-commands. see the "PLUG-IN SYSTEM" section of this man page for more details. yes she's extensible, she contains multitudes. π
β¨ OPTIONS β¨
-dβ print debug information.gfservicepasses this option togfservice-agentso that alsogfservice-agentoutputs debug information. double the debug, double the fun. π₯-f fileβ read configuration fromfileinstead of the default.-t timeβ set operation timeout intimeseconds. whengfservicetries to start or stop a server program (gfmd,gfsdor a backend database), she waits until the operation is complete or thetimeinterval is elapsed. if"no"is specified astime, timeout never occurs. the default value is"no". (so by default she's patient. very demure. very mindful. π)-kβ when this option is specified with sub-commandconfig-gfarmorconfig-gfarm-master,gfservicecreates a shared secret key files usinggfkeycommand. π
β¨ SUB-COMMANDS FOR GFMD β¨
the followings are sub-commands which operate gfmd. and listen β the given host-id argument must be "gfmdn" (gfmd1, gfmd2, ...). otherwise gfservice reports an error and exits immediately. she is not flexible about this. she is not going to figure it out for you. π€
backend-db-status host-idβ exit with an exit code0, if a backend database is currently running. otherwise exits with1.gfmd-status host-idβ exit with an exit code0, ifgfmdis currently running. otherwise exits with1.start-backend-db host-idβ start a backend database if it is not running currently.start-gfmd host-idβ startgfmdif it is not running currently.start-gfmd-master host-idβ an alias of"start-gfmd"sub-command.start-gfmd-slave host-idβ this sub-command is the same as"start-gfmd", but-Soption is added togfmd.start-gfarm host-idβ start a backend database andgfmdif they are not running currently.start-gfarm-master host-idβ an alias of"start-gfarm"sub-command.start-gfarm-slave host-idβ this sub-command is the same as"start-gfarm", but-Soption is added togfmd.stop-backend-db host-idβ stop a backend database if it is running currently.stop-gfmd host-idβ stopgfmdif it is running currently.stop-gfarm host-idβ stopgfmdand a backend database if they are running currently.kill-gfmd host-idβ killgfmd(sendSIGKILL) if it is running currently. yeah, she said what she said. πrestart-backend-db host-idβ perform"stop-backend-db"and"start-backend-db"sub-commands successively.restart-gfmd host-idβ perform"stop-gfmd"and"start-gfmd"sub-commands successively.restart-gfmd-master host-idβ an alias of"restart-gfmd"sub-command.restart-gfmd-slave host-idβ perform"stop-gfmd"and"start-gfmd-slave"sub-commands successively.restart-gfarm host-idβ perform"stop-gfarm"and"start-gfarm"sub-commands successively.restart-gfarm-master host-idβ an alias of"restart-gfarm"sub-command.restart-gfarm-slave host-idβ perform"stop-gfarm"and"start-gfarm-slave"sub-commands successively.promote host-idβ promotegfmdfrom a slave to a master. glow up moment fr fr πpromote-gfmd host-idβ an alias of"promote"sub-command.set-gfmd-conf host-id directive valueβ add
directive value
line to gfmd.conf file on the remote host. if gfmd.conf already has a directive line, gfservice deletes it and then add a new line. out with the old, in with the new β¨
set-gfsd-conf host-id directive valueβ add
directive value
line to gfsd.conf file on the remote host. if gfsd.conf already has a directive line, gfservice deletes it and then add a new line.
unset-gfmd-conf host-id directiveβ delete a directive line ingfmd.conffile on the remote host. ifgfmd.conffile doesn't contain directive line, the file is unchanged.unset-gfsd-conf host-id directiveβ delete a directive line ingfsd.conffile on the remote host. ifgfsd.conffile doesn't contain directive line, the file is unchanged.backup-backend-dbβ backup a backend database on the remote host and output the backup data to standard out. πbackup-gfmd-conf host-idβ outputgfmd.conffile on the remote host to standard out.backup-gfsd-conf host-idβ outputgfsd.conffile on the remote host to standard out. this sub-command can be worked only when the remote host is configured in the private mode.backup-usermap host-idβ output usermap file on the remote host to standard out. this sub-command can be worked only when the remote host is configured in the private mode.restore-backend-db host-idβ restore a backend database on the remote host. the backup data are read from standard in.restore-gfmd-conf host-idβ recovergfmd.conffile on the remote host.gfservicereads a backup ofgfmd.conffrom standard in.restore-gfsd-conf host-idβ recovergfsd.conffile on the remote host.gfservicereads a backup ofgfsd.conffrom standard in. this sub-command can be worked only when the remote host is configured in the private mode.restore-usermap host-idβ recover usermap file on the remote host.gfservicereads a backup of usermap from standard in. this sub-command can be worked only when the remote host is configured in the private mode.config-gfarm host-idβ executeconfig-gfarmcommand on the remote host. if"gfmdn_CONFIG_GFARM_OPTIONS"variable is declared in the configuration file ofgfservice, its value is passed toconfig-gfarmcommand as options. don't use this sub-command when you want to enable replication ofgfmd. instead, use"config-gfarm-master"or"config-gfarm-slave"sub-command in that case. if-koption is specified,gfservicealso creates a shared secret key files onto thegfmdhost, usinggfkeycommand. πconfig-gfarm-master host-idβ this sub-command is the same asconfig-gfarmbutgfmdreplication is enabled automatically.config-gfarm-slave host-id master-host-idβ this sub-command is the same asconfig-gfarmbutgfmdreplication is enabled automatically and the remotegfmdhost is configured as a slave ofmaster-host-id. thengfserviceregisters the slave host to a server list usinggfmdhostcommand.gfservicealso adds the slave host tometadb_server_listdirective ingfarm2.conffile on the mastergfmdhost and distribute the updatedgfarm2.conffile to all hosts defined in the configuration file. it also updatesgfsd.conffile and distributes it to allgfmdandgfsdhosts, if"gfmdn_PRIVATE_MODE"variable is set to"true". if the value of the variable"gfmdn_AUTH_TYPE"is"sharedsecret", it also copies a shared key file from the mastergfmdto the slavegfmdhost. she does a lot, okay? she's carrying this whole operation. πunconfig-gfarm host-idβ execute"stop-gfarm"sub-command and then delete all files and directories created bygfmdand a backend database. if you want to unconfigure a slavegfmd, use"unconfig-gfarm-slave"sub-command instead.unconfig-gfarm-master host-idβ an alias of"unconfig-gfarm"sub-command.unconfig-gfarm-slave host-id master-host-idβ this sub-command is the same as"unconfig-gfarm", butgfservicedoes some additional works. it also deletes the slave host from a server list usinggfmdhostcommand and frommetadb_server_listdirective ingfarm2.conffile on all hosts defined in the configuration file. it also updatesgfsd.conffile and distributes it to allgfmdandgfsdhosts, if"gfmdn_PRIVATE_MODE"variable is set to"true".
β¦and bestie, that's literally not even all of it, don't go anywhere π
β¨ SUB-COMMANDS FOR GFSD β¨
Okay bestie, these ones drive gfsd around π
. And listen β the host-id you hand over must be gfsdn shaped (gfsd1, gfsd2, β¦). If it's not, gfservice just goes "nope" and exits immediately, no negotiation, no vibe check. π
gfsd-status host-idβ exits with code0ifgfsdis running right this second. If it's not? Exits with1. That's it, that's the whole personality. β¨start-gfsdβ startsgfsd, but only if it isn't already running. No double-starting, we're not messy. πstop-gfsdβ stopsgfsd, but only if it is currently running. Considerate. π«Άrestart-gfsd host-idβ doesstop-gfsdand thenstart-gfsd, one right after the other. Glow-up arc, basically. πΈset-gfsd-conf host-id directive valueβ same as theset-gfsd-confsub-command forgfmd. πunset-gfsd-conf host-id directiveβ same as theunset-gfsd-confsub-command forgfmd.backup-gfsd-conf host-idβ same as thebackup-gfsd-confsub-command forgfmd.backup-usermap host-idβ same as thebackup-usermapsub-command forgfmd.restore-gfsd-conf host-idβ same as therestore-gfsd-confsub-command forgfmd.restore-usermap host-idβ same as therestore-usermapsub-command forgfmd.config-gfsd host-idβ runs theconfig-gfsdcommand on the remote host. If the variablegfsdn_CONFIG_GFSD_OPTIONSis declared in the config file ofgfservice, its value gets passed to theconfig-gfsdcommand as options.gfservicealso registers that configured remote host as a filesystem node using thegfhostcommand. And if the value of the variablegfsdn_AUTH_TYPEissharedsecret, it also copies a shared key file fromgfmd1over to thegfsdhost. π₯unconfig-gfsd host-idβ runs thestop-gfsdsub-command and then deletes all files and directories thatgfsdcreated. Full clear-out. π
π SUB-COMMANDS FOR CLIENT π
Now we're doing client stuff. The host-id here has to be gfmdn (gfmd1, gfmd2, β¦), gfsdn (gfsd1, gfsd2, β¦) or clientn (client1, client2, β¦). Get it wrong and gfservice reports an error and exits immediately. Be so serious. π€
mount host-id directory option...β mounts a Gfarm2 filesystem on directory on the remote host. Each option is an option to thegfarm2fscommand. πunmount host-id directoryβ unmounts a Gfarm2 filesystem on directory on the remote host.umount host-id directoryβ an alias of theunmountsub-command. Same girl, different name. πset-gfarm-conf host-id directive valueβ adds a line
directive value
to the gfarm2.conf file on the remote host. If gfarm2.conf already has a directive line, gfservice deletes it and then adds a new line. Out with the old, in with the new. β¨
unset-gfarm-conf host-id directiveβ deletes a directive line in thegfarm2.conffile on the remote host. If thegfarm2.conffile doesn't contain that directive line, the file stays unchanged. No touchy. πbackup-gfarm-conf host-idβ outputs thegfarm2.conffile on the remote host to standard out. π€backup-shared-key host-idβ outputs a shared secret key file to standard out. πrestore-gfarm-conf host-idβ recovers thegfarm2.conffile on the remote host.gfservicereads a backup ofgfarm2.conffrom standard in. π₯restore-shared-key host-idβ recovers a shared secret key file on the remote host.gfservicereads a backup of the shared secret key from standard in. πconfig-client host-idβ copies thegfarm2.conffile fromgfmd1to the client host. If the value of the variableclientn_AUTH_TYPEissharedsecret, it also copies a shared key file fromgfmd1to the client host. π¦unconfig-client host-idβ deletes thegfarm2.conffile and a shared secret key file on the remote host.gfcmd host-id command-name command-argument ...β executes a Gfarm command on the remote host. πgfcmd-root host-id command-name command-argument ...β executes a Gfarm command on the remote host with root privilege. Main character energy, but make itroot. πgrid-proxy-init host-id command-argument ...β executes thegrid-proxy-initcommand on the remote host. β
π SUB-COMMANDS FOR MULTIPLE HOSTS π
These ones operate on a whole squad of hosts at once. And here's the thing β the host-id argument must not be specified. Don't even try it bestie. π«
start-allβ starts all backend databases,gfmdservers andgfsdservers. Everybody up! πstop-allβ stops allgfsdservers,gfmdservers and backend databases,kill-gfmd-allβ kills (sendsSIGKILL) allgfmdservers. Dramatic? Yes. Necessary? Also yes. πrestart-allβ performs thestop-allandstart-allsub-commands successively.config-allβ performsconfig-gfarm-masterforgfmd1andconfig-gfarm-slavefor all othergfmdnodes. Then, performsconfig-gfsdfor allgfdsnodes. Finally, performsconfig-clientfor all client nodes. It's giving assembly line. πunconfig-allβ performsunconfig-clientfor all client nodes. Then, performsunconfig-gfsdfor allgfdsnodes. Finally, performsunconfig-gfarmfor allgfmdnodes. Reverse order, we're dismantling the whole thing. π§Ή
π§ PLUG-IN SYSTEM π§
Not me telling you gfservice is literally extensible?? It has a plug-in system so you β yes YOU β can add new sub-commands. If a given sub-command isn't provided by gfservice, it goes looking for a file with the name of that sub-command under the %%DATADIR%%/gfarm/gfservice directory. iykyk. πΈ
The sub-command file must be written as a Bourne shell script. For a sub-command called name, the sub-command file must have a shell function named subcmd_name, which will be executed from gfservice, and subcmd_name_agent, which will be executed from gfservice-agent. β¨
For the case where a sub-command depends on another user-provided sub-command, the sub-command file for sub-command name must have a shell function named name_depends, which must return a list of sub-commands. That list of sub-commands must be a string which is a space separated list of sub-command names. If the sub-command or its agent does not have dependencies, return an empty string. Similarly, the sub-command file must have a shell function named name_agent_depends, which must return a list of the sub-command's agents. π«Ά
Bestie reminder: those function names and that path are exact. Shell function names don't do nicknames. π
And that's the whole page, gorgeous. π This one's from the Gfarm crew, dated 6 Jun 2013, filed under GFSERVICE(1) β go forth and configure your cluster, you absolute icon. πβ¨π
π¦ where this page comes from
- debian bookworm: gfarm-client 2.7.20+dfsg-1+b2 Β· BSD-like
- debian trixie: gfarm-client 2.7.20+dfsg-1.2+b1 Β· BSD-like
- ubuntu noble: gfarm-client 2.7.20+dfsg-1.1ubuntu1 Β· BSD-like
- ubuntu questing: gfarm-client 2.7.20+dfsg-1.2
- ubuntu resolute: gfarm-client 2.7.20+dfsg-1.3 Β· BSD-like
- ubuntu stonking: gfarm-client 2.7.20+dfsg-1.3build1 Β· BSD-like
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms