dsh

From Gentoo Wiki
Jump to:navigation Jump to:search

This article is a stub. Please help out by expanding it - how to get started.

dsh is a shell that allows parallel execution of remote commands across large numbers of servers. Generally called "distributed shell" dsh was often leveraged as an orchestration tool prior to the rise of modern alternatives. Even to this day, dsh is still used by some system administrators where heavyweight tools such as Ansible are impractical or inefficient.

Installation

USE flags

USE flags for app-shells/dsh Distributed Shell

nls Add Native Language Support (using gettext - GNU locale utilities)

Emerge

root #emerge --ask app-shells/dsh

Configuration

Environment variables

  • $DSH_FANOUT - the maximum number of concurrent remote shell commands
  • $DSH_REMOTE_CMD - used to specify a remote shell other than the default rsh, typically ssh.
  • $DSH_NODE_LIST - the location of the host list.
  • $WCOLL - (deprecated) the location of the host list.
  • $DSH_PATH - the default path for remote command execution, $PATH by default.

Files

Global Configuration Files

  • /etc/dsh/machines.list - the list of machine names to be used for when -a command-line option is specified.
  • /etc/dsh/group/<group_name> - the list of machine names to be used for when -g group name command-line option is specified.
  • /etc/dsh/dsh.conf - the configuration file containing the day-to-day default.

User Specific Configuration Files

  • $HOME/.dsh/machines.list - the list of machine names to be used for when -a command-line option is specified.
  • $HOME/.dsh/group/<group_name> - the list of machine names to be used for when -g group name command-line option is specified.
  • $HOME/.dsh/dsh.conf - the configuration file containing the day-to-day default.

Usage

First, tell dsh where to find the server list:

user $DSH_NODE_LIST=~/<server.list>

Second, tell dsh what command to run:

user $dsh -v '<remote_command>'
Note
Without the -v (verbose) flag remote commands will be executed but no output will be visible to the user.

Invocation

user $dsh --help

See also

  • Bash — the default shell on Gentoo systems and a popular shell program found on many Linux systems.
  • Ansible — an agentless automation system written in Python.
  • Rex — a configuration automation framework written in Perl known for its shallow learning curve and ease of extensibility
  • Sparrow