← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 294961c: MDEV-10538: MariaDB fails to start without galera_recovery in systemd mode

 

Hi Nirbhay,

Ok to push. I suggest that we avoid such overcomplicated constructs in our
default systemd configuration. Consider integrating recovery into the server
(I know it's not trivial) or creating "included" config for galera.

Thanks,
Sergey

On Mon, Aug 22, 2016 at 06:38:07PM -0400, Nirbhay Choubey wrote:
> revision-id: 294961cc4d4d55730e807b3f0a7f93a3dd4d4f7b (mariadb-10.1.16-14-g294961c)
> parent(s): d0d99dec914d409d7889fcec2efd126edad10bde
> author: Nirbhay Choubey
> committer: Nirbhay Choubey
> timestamp: 2016-08-22 18:38:06 -0400
> message:
> 
> MDEV-10538: MariaDB fails to start without galera_recovery in systemd mode
> 
> Update ExecStartPre scripts to not fail if 'galera_recovery'
> script is not available.
> 
> ---
>  support-files/mariadb.service.in  |  6 ++++--
>  support-files/mariadb@xxxxxxxxxxx | 15 +++++++++------
>  2 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
> index 6b8b2ba..9b97172 100644
> --- a/support-files/mariadb.service.in
> +++ b/support-files/mariadb.service.in
> @@ -63,9 +63,11 @@ PermissionsStartOnly=true
>  # galera_recovery simply returns an empty string. In any case, however,
>  # the script is not expected to return with a non-zero status.
>  # It is always safe to unset _WSREP_START_POSITION environment variable.
> +# Do not panic if galera_recovery script is not available. (MDEV-10538)
>  ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
> -ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \
> - systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
> +ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
> + VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
> + && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
>  
>  # Needed to create system tables etc.
>  # ExecStartPre=/usr/bin/mysql_install_db -u mysql
> diff --git a/support-files/mariadb@xxxxxxxxxxx b/support-files/mariadb@xxxxxxxxxxx
> index 965e852..e941f21 100644
> --- a/support-files/mariadb@xxxxxxxxxxx
> +++ b/support-files/mariadb@xxxxxxxxxxx
> @@ -70,16 +70,19 @@ PermissionsStartOnly=true
>  # galera_recovery simply returns an empty string. In any case, however,
>  # the script is not expected to return with a non-zero status.
>  # It is always safe to unset _WSREP_START_POSITION%I environment variable.
> +# Do not panic if galera_recovery script is not available. (MDEV-10538)
>  ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I"
> -ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery             \
> -  --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf`; [ $? -eq 0 ] && \
> -  systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
> +
> +ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
> + VAR=`/usr/bin/galera_recovery --defaults-file=@INSTALL_SYSCONF2DIR@/my%I.cnf`; [ $? -eq 0 ] \
> + && systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
> +
>  # Alternate: (remove ConditionPathExists above)
>  # use [mysqld.INSTANCENAME] as sections in my.cnf
>  #
> -#ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery \
> -# --defaults-group-suffix=%I`; [ $? -eq 0 ] &&          \
> -# systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
> +#ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
> +# VAR=`/usr/bin/galera_recovery --defaults-group-suffix=%I`; [ $? -eq 0 ] \
> +# && systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
>  
>  # Needed to create system tables etc.
>  # ExecStartPre=/usr/bin/mysql_install_db -u mysql
> _______________________________________________
> commits mailing list
> commits@xxxxxxxxxxx
> https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits