Skip to content

Commit

Permalink
fix: osh-sync-watcher: default to a valid rshcmd (fixes #433)
Browse files Browse the repository at this point in the history
  • Loading branch information
speed47 committed Feb 20, 2024
1 parent a458e4b commit f705acf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions bin/admin/osh-sync-watcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ if [ "$enabled" != "1" ] ; then
exit 0
fi

# check that rshcmd is not empty after loading the config
if [ -z "$rshcmd" ]; then
_err "The 'rshcmd' mandatory config value is empty, please review the configuration ($configfile)"
exit 1
fi

# is another copy of myself still running ?
if [ -e "$PIDFILE" ] ; then
oldpid=$(head -1 "$PIDFILE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ rshcmd

:Default: ``""``

:Example: ``"ssh -q -i /root/.ssh/id_master2slave"``
:Example: ``"ssh -q -i /root/.ssh/id_master2slave -o StrictHostKeyChecking=accept-new"``

This value will be passed as the ``--rsh`` parameter of ``rsync`` (don't use ``-p`` to specify the port heree, use the ``remotehostlist`` config below instead), this can be used to specify which SSH key to use, for example. Note that this option is mandatory (if you don't have anything to specify here, you can just say ``ssh``).
This value will be passed as the ``--rsh`` parameter of ``rsync`` (don't use ``-p`` to specify the port here, use the ``remotehostlist`` config below instead), this can be used to specify which SSH key to use, for example. NOTE THAT THIS OPTION IS MANDATORY (if you don't have anything to specify here, you can just say ``ssh``). If you followed the standard installation procedure, the "example" value specified below will work.

remoteuser
**********
Expand Down
6 changes: 3 additions & 3 deletions etc/bastion/osh-sync-watcher.sh.dist
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ timeout=120
# >> These options configure how the primary bastion should push its configuration to the secondaries
#
# rshcmd (string)
# DESC: This value will be passed as the ``--rsh`` parameter of ``rsync`` (don't use ``-p`` to specify the port heree, use the ``remotehostlist`` config below instead), this can be used to specify which SSH key to use, for example. Note that this option is mandatory (if you don't have anything to specify here, you can just say ``ssh``).
# DESC: This value will be passed as the ``--rsh`` parameter of ``rsync`` (don't use ``-p`` to specify the port here, use the ``remotehostlist`` config below instead), this can be used to specify which SSH key to use, for example. NOTE THAT THIS OPTION IS MANDATORY (if you don't have anything to specify here, you can just say ``ssh``). If you followed the standard installation procedure, the "example" value specified below will work.
# DEFAULT: ""
# EXAMPLE: "ssh -q -i /root/.ssh/id_master2slave"
rshcmd=""
# EXAMPLE: "ssh -q -i /root/.ssh/id_master2slave -o StrictHostKeyChecking=accept-new"
rshcmd="ssh -q -i /root/.ssh/id_master2slave -o StrictHostKeyChecking=accept-new"
#
# remoteuser (string)
# DESC: The remote user to connect as, using ``ssh`` while rsyncing to secondaries. You probably don't need to change this.
Expand Down

0 comments on commit f705acf

Please sign in to comment.