Guest agent won't start on Xenial Percona 5.7

Trove guest agent on Ubuntu Xenial Percona 5.7 image won't start
because of a missing header/section in "/etc/mysql/my.cnf" file.

To fix that, we only have to check if a section exists, if not
a [mysql] section is automatically created.

Change-Id: If3b1166fc04985763ae522f5eac022d53f2a366f
Closes-Bug: #1744107
This commit is contained in:
Gaetan Trellu 2018-01-18 10:57:23 -05:00
parent ffa6019e90
commit fe49104288
1 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,6 @@
#!/bin/bash
# Create [mysql] section if no section exsists in /etc/mysql/my.cnf
if ! grep -q -P '^\[.*\]' /etc/mysql/my.cnf; then
sed -i '1s/^/[mysql]\n/' /etc/mysql/my.cnf
fi