From 8814eb4ba23d36ec33de52440f6921a55a05b1da Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 25 May 2020 11:47:10 +0200 Subject: [PATCH 1/2] Fix _common.sh & helpers source --- scripts/_common.sh | 2 ++ scripts/install | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6bf639c..c6b3b07 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ PKG_DEPENDENCIES="sqlite3 libldap2-dev libsasl2-dev python3-dev imagemagick pyth #PKG_DEPENDENCIES="sqlite3 python3-pip imagemagick" DOSSIER_MEDIA=/home/yunohost.multimedia +LOG_FILE=/var/log/$app/$app.log +ACCESS_LOG_FILE=/var/log/$app/$app-access.log #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/install b/scripts/install index 2a39dd8..32ff154 100755 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -21,15 +20,14 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE upload=$YNH_APP_ARG_UPLOAD -public_library=$7YNH_APP_ARG_PUBLIC_LIBRARY +public_library=$YNH_APP_ARG_PUBLIC_LIBRARY #if app is public, we assume library is public if [ $is_public -eq 1 ]; then public_library=1 fi -LOG_FILE=/var/log/$app/$app.log -ACCESS_LOG_FILE=/var/log/$app/$app-access.log +source _common.sh #================================================= # MANAGE SCRIPT FAILURE From 5eeab06729b1a57034b773deeb065cb1ffa57a78 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 25 May 2020 20:42:31 +0200 Subject: [PATCH 2/2] Remove $port from service check --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 32ff154..a60559b 100755 --- a/scripts/install +++ b/scripts/install @@ -177,7 +177,9 @@ chown -R $app:$app /var/log/$app #================================================= ynh_script_progression --message="Setting up database and settings..." --weight=5 #we need to start and stop the service so that initial app.db file is created and that we can set default data -ynh_systemd_action --service_name=$app --action="start" --line_match="server on :$port" --log_path="$final_path/calibre-web.log" -t 30 +#If port 8083 is already in use (ex for second instance), then service start will fail, which is expected : so we do not want +#to set $port on the line match. "server on" will be displayed in case the port is already in use and should be ok to spot the fact that the database is initialized. +ynh_systemd_action --service_name=$app --action="start" --line_match="server on " --log_path="$final_path/calibre-web.log" -t 30 #sleep required on low spec like raspberryPi sleep 2s #remove unwanted calibre-web.log