Use `chpst` instead of `su` in mariadb_ctl script
-#!/bin/bash
+#!/usr/bin/env bash
set -e
set -o pipefail
@@ -88,8 +88,11 @@ case $1 in
cd $MARIADB_CTRL_PACKAGE
echo "start script: starting mariadb_ctrl..."
- su - vcap -c -o pipefail \
- "<%= disable_sst_string %> PATH=$PATH PERL5LIB=$PERL5LIB $MARIADB_CTRL_PACKAGE/bin/mariadb_ctrl \
+ chpst -u vcap:vcap bash -c "
+ <%= disable_sst_string %> \
+ PATH=$PATH \
+ PERL5LIB=$PERL5LIB \
+ $MARIADB_CTRL_PACKAGE/bin/mariadb_ctrl \
-configPath=$CONFIG_FILE \
>> $LOG_FILE 2>&1" &
