Commit e9787ef4 authored by Vincent Pelletier's avatar Vincent Pelletier

stack.erp5: Abort also if pidfile cannot be read.

parent 61753143
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# not need these here). # not need these here).
[mariadb-resiliency-after-import-script] [mariadb-resiliency-after-import-script]
filename = instance-mariadb-resiliency-after-import-script.sh.in filename = instance-mariadb-resiliency-after-import-script.sh.in
md5sum = 5fc1bb6ade3458e0c2970c31ca7157ea md5sum = 1e89de954d816b93f76d9b75820d192c
[template-mariadb] [template-mariadb]
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
......
...@@ -23,7 +23,11 @@ update_executable='${update-mysql:output}' ...@@ -23,7 +23,11 @@ update_executable='${update-mysql:output}'
# Make sure mariadb is not already running # Make sure mariadb is not already running
if [ -e "$pid_file" ]; then if [ -e "$pid_file" ]; then
pid=$(cat "$pid_file") > /dev/null 2>&1 pid=$(cat "$pid_file")
if [ $? -ne 0 ]; then
echo "Cannot read Mariadb pidfile, assuming running. Aborting."
exit 1
fi
if kill -0 "$pid"; then if kill -0 "$pid"; then
echo "Mariadb is already running with pid $pid. Aborting." echo "Mariadb is already running with pid $pid. Aborting."
exit 1 exit 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment