From ac72dbc1717aade7187fa29bd2d8ee323ed72397 Mon Sep 17 00:00:00 2001 From: Shuai Lin Date: Mon, 21 Nov 2016 10:50:30 +0800 Subject: [PATCH] Fixed scripts. --- image/base/services/memcached.sh | 2 +- image/base/services/mysql.sh | 8 +++++--- image/base/services/nginx.sh | 2 +- scripts/bootstrap.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/image/base/services/memcached.sh b/image/base/services/memcached.sh index 2a50a10..acebfdc 100755 --- a/image/base/services/memcached.sh +++ b/image/base/services/memcached.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # `/sbin/setuser memcache` runs the given command as the user `memcache`. # If you omit that part, the command will be run as root. exec /sbin/setuser memcache /usr/bin/memcached >>/var/log/memcached.log 2>&1 diff --git a/image/base/services/mysql.sh b/image/base/services/mysql.sh index c6a6649..984e682 100755 --- a/image/base/services/mysql.sh +++ b/image/base/services/mysql.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e shutdown_mysql() { if [[ -d /var/run/mysqld/mysqld.sock ]]; then - mysqladmin -u root shutdown + mysqladmin -u root shutdown || true fi } @@ -13,4 +13,6 @@ trap shutdown_mysql EXIT mkdir -p /var/run/mysqld chown mysql:mysql /var/run/mysqld -/sbin/setuser mysql /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 >&1 >/var/log/mysql.log 2>&1 +rm -f /var/lib/mysql/aria_log_control + +/sbin/setuser mysql /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 >/var/log/mysql.log 2>&1 diff --git a/image/base/services/nginx.sh b/image/base/services/nginx.sh index 61e04b9..21060ee 100755 --- a/image/base/services/nginx.sh +++ b/image/base/services/nginx.sh @@ -1,3 +1,3 @@ -#!/bin/sh +#!/bin/bash exec 2>&1 exec /usr/sbin/nginx diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index 6b1ff15..15539cf 100755 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -16,7 +16,7 @@ import uuid import time from utils import ( - call, get_conf, get_install_dir, show_progress + call, get_conf, get_install_dir, show_progress, get_script, render_template, get_seafile_version, eprint )