Merge remote-tracking branch 'github/release-3.4.1' into release-3.4.1

This commit is contained in:
Bay 2017-12-27 18:21:10 +08:00
commit 039ce238cf
2 changed files with 20 additions and 2 deletions

View File

@ -320,8 +320,14 @@ function run() {
proxy
dc-compose ps | grep "proxy" > /dev/null
if [ $? -eq 0 ];then
_EXIT=1
for ((i=1;i<=3;i++ )); do
sleep 3
log.info "retry $i get rbd-proxy "
dc-compose ps | grep "proxy" && export _EXIT=0 && break
done
if [ $_EXIT -eq 0 ];then
log.stdout '{
"status":[
{

View File

@ -165,12 +165,24 @@ function proc::restart(){
return 0
}
function add_user() {
grep rain /etc/group >/dev/null 2>&1 || groupadd -g 200 rain
id rain >/dev/null 2>&1 || (
useradd -m -s /bin/bash -u 200 -g 200 rain
echo "rain ALL = (root) NOPASSWD:ALL" > /etc/sudoers.d/rain
chmod 0440 /etc/sudoers.d/rain
)
log.info "add_user ok"
}
function prepare() {
log.info "RBD: install basic service: docker"
[ -d "/etc/goodrain/envs" ] || mkdir -p /etc/goodrain/envs
[ -d "/root/.docker" ] || mkdir -p /root/.docker
[ -f "/root/.docker/config.json" ] || echo "{}" >> /root/.docker/config.json
log.info "prepare docker..."
log.info "add rain user"
add_user
}
function write_docker_config() {