This is an automated email from the ASF dual-hosted git repository. ioleksandr pushed a commit to branch DLAB-3 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-3 by this push: new d094ac8 add cron reboot job and autorestart to dockers d094ac8 is described below commit d094ac8509a120de2a445c33792353e3fcd92af6 Author: Oleksandr_Isniuk <i.oleksa...@gmail.com> AuthorDate: Tue May 14 11:41:37 2019 +0300 add cron reboot job and autorestart to dockers --- .../src/ssn/scripts/configure_docker.py | 4 +++- .../src/ssn/templates/mysql.sh | 27 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py index 0c5e37f..e79c63c 100644 --- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py +++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py @@ -123,8 +123,10 @@ def configure_guacamole(): sudo("docker run --name guacamole --restart unless-stopped --link guacd:guacd --link guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e MYSQL_PASSWORD='guacamole' -d -p 8080:8080 guacamole/guacamole") #create cronjob for run containers on reboot sudo('mkdir /opt/dlab/cron') - sudo('touch /opt/dlab/cron/mysql.sh') + sudo('mv /root/templates/mysql.sh /opt/dlab/cron/mysql.sh') sudo('chmod 755 /opt/dlab/cron/mysql.sh') + sudo('sed -i "s|MYSQL_GENERATED_PASS|{}| /opt/dlab/cron/mysql.sh"'.format(mysql_pass)) + sudo('crontab -l | { cat; echo "@reboot sh /opt/dlab/cron/mysql.sh"; } | crontab -') return True except Exception as err: traceback.print_exc() diff --git a/infrastructure-provisioning/src/ssn/templates/mysql.sh b/infrastructure-provisioning/src/ssn/templates/mysql.sh new file mode 100644 index 0000000..09fddda --- /dev/null +++ b/infrastructure-provisioning/src/ssn/templates/mysql.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# ***************************************************************************** +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# ****************************************************************************** + +docker start guacd +docker start guac-mysql +docker rm guacamole +docker run --name guacamole --restart unless-stopped --link guacd:guacd --link guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e MYSQL_PASSWORD='MYSQL_GENERATED_PASS' -d -p 8080:8080 guacamole/guacamole \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org