diff --git a/scripts/install b/scripts/install index 842843d..85cacff 100755 --- a/scripts/install +++ b/scripts/install @@ -32,6 +32,12 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config +mkdir -p "/var/log/$app" +chmod 640 "/var/log/$app" + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + yunohost service add "$app" --description="Cross platform reading server" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/restore b/scripts/restore index ea8d31e..b139591 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,6 +48,12 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable "$app".service --quiet +mkdir -p "/var/log/$app" +chmod 640 "/var/log/$app" + +# Use logrotate to manage app-specific logfile(s) +ynh_use_logrotate --non-append + yunohost service add "$app" --description="Cross platform reading server" --log="/var/log/$app/$app.log" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b39a7d0..94b9df5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,6 +77,9 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config +mkdir -p "/var/log/$app" +chmod 640 "/var/log/$app" + # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append