From 790578cedafd11e0fdee4b0c9de85453287ad591 Mon Sep 17 00:00:00 2001 From: ljf Date: Thu, 9 Nov 2017 11:40:43 +0100 Subject: [PATCH] [fix] Mongodb fails starting on second install --- .gitignore | 3 +++ conf/app.src | 6 +++--- manifest.json | 2 +- scripts/install | 10 +++++----- scripts/restore | 2 +- scripts/upgrade | 4 ++++ 6 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e961147 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.swp +*.swo + diff --git a/conf/app.src b/conf/app.src index 2d09448..f23f5b7 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.45/wekan-0.45.tar.gz -SOURCE_SUM=4245f6674e407ad40bc899788058887213d5daf8d7620e0ae0c07af22b7c82aa +SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.54/wekan-0.54.tar.gz +SOURCE_SUM=fc3be49f1f317182a838f4b0deb058c35226e9d4609af9ea2050b4b866b2d4b1 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=wekan-0.45.tar.gz +SOURCE_FILENAME=wekan-0.54.tar.gz diff --git a/manifest.json b/manifest.json index fdae424..3fad3fa 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "Wekan", "id": "wekan", "packaging_format": 1, - "version": "0.45-2", + "version": "0.54-2", "description": { "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" diff --git a/scripts/install b/scripts/install index a40e004..35e6d8b 100755 --- a/scripts/install +++ b/scripts/install @@ -51,8 +51,8 @@ ynh_app_setting_set $app port $port ynh_install_nodejs 4.8.4 # Install mongodb -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 -echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 +echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/testing main" > /etc/apt/sources.list.d/mongodb-org.list ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools" @@ -89,8 +89,8 @@ npm install popd # Start mogodb -systemctl start mongod systemctl enable mongod +systemctl restart mongod #================================================= # SETUP SYSTEMD @@ -99,7 +99,7 @@ systemctl enable mongod ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__DB_NAME__" "$app" "../conf/systemd.service" -ynh_replace_string "__URI__" "$path_url" "../conf/systemd.service" +ynh_replace_string "__URI__" "$path_url/" "../conf/systemd.service" ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" ynh_replace_string "__DOMAIN__" "$domain" "../conf/systemd.service" ynh_add_systemd_config @@ -135,4 +135,4 @@ fi # RELOAD NGINX #================================================= systemctl reload nginx -systemctl start $app +systemctl restart $app diff --git a/scripts/restore b/scripts/restore index e620557..301b453 100644 --- a/scripts/restore +++ b/scripts/restore @@ -64,8 +64,8 @@ ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell m # RESTORE DB #================================================= # Start mogodb -systemctl start mongod systemctl enable mongod +systemctl start mongod mongorestore --db $app ./dump #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2d4cc31..949a37b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,6 +47,10 @@ fi if ynh_version_gt "0.45-3" "${version}" ; then yunohost service add wekan fi +if ynh_version_gt "0.54-2" "${version}" ; then + systemctl enable mongod + systemctl restart mongod +fi #================================================= # STANDARD UPGRADE STEPS