repmgr daemon start

repmgr daemon start

Start the &repmgrd; daemon on the local node

## Description

This command starts the &repmgrd; service on the local node.

By default, &repmgr; will wait for up to 15 seconds to confirm that &repmgrd; started. This behaviour can be overridden by specifying a different value using the `--wait` option, or disabled altogether with the `--no-wait` option.

The `repmgr.conf` parameter `repmgrd_service_start_command` must be set for `repmgr daemon start` to work; see section repmgr-daemon-start-configuration for details.

## Options

`--dry-run`

- Check prerequisites but don't actually attempt to start &repmgrd;.

  This action will output the command which would be executed.

`-w`

`--wait`

- Wait for the specified number of seconds to confirm that &repmgrd; started successfully.

  Note that providing `--wait=0` is the equivalent of `--no-wait`.

`--no-wait`

- Don't wait to confirm that &repmgrd; started successfully.

  This is equivalent to providing `--wait=0`.

## Configuration file settings

The following parameter in `repmgr.conf` is relevant to `repmgr daemon start`:

`repmgrd_service_start_command`

- `repmgr daemon start` will execute the command defined by the `repmgrd_service_start_command` parameter in `repmgr.conf`. This must be set to a shell command which will start &repmgrd;; if &repmgr; was installed from a package, this will be the service command defined by the package. For more details see Appendix: &repmgr; package details.

  If &repmgr; was installed from a system package, and you do not configure `repmgrd_service_start_command` to an appropriate service command, this may result in the system becoming confused about the state of the &repmgrd; service; this is particularly the case with `systemd`.

## Exit codes

One of the following exit codes will be emitted by `repmgr daemon start`:

`SUCCESS (0)`

- The &repmgrd; start command (defined in `repmgrd_service_start_command`) was successfully executed.

  If the `--wait` option was provided, &repmgr; will confirm that &repmgrd; has actually started up.

`ERR_BAD_CONFIG (1)`

- `repmgrd_service_start_command` is not defined in `repmgr.conf`.

`ERR_DB_CONN (6)`

- &repmgr; was unable to connect to the local PostgreSQL node.

  PostgreSQL must be running before &repmgrd; can be started. Additionally, unless the `--no-wait` option was provided, &repmgr; needs to be able to connect to the local PostgreSQL node to determine the state of &repmgrd;.

`ERR_REPMGRD_SERVICE (27)`

- The &repmgrd; start command (defined in `repmgrd_service_start_command`) was not successfully executed.

  This can also mean that &repmgr; was unable to confirm whether &repmgrd; successfully started (unless the `--no-wait` option was provided).

## See also

repmgr-daemon-stop, repmgrd-daemon, repmgr-service-status, repmgr-service-pause, repmgr-service-unpause