adjust logging for v15 changes

This commit is contained in:
trendless
2026-06-15 18:39:50 -06:00
parent 4f74409542
commit efee1e5c05
8 changed files with 49 additions and 37 deletions
+16 -8
View File
@@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemctl --service=$app --action="stop" --wait_until="was stopped successfully"
ynh_systemctl --service="$app" --action="stop" --log_path=systemd --wait_until="was stopped successfully"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@@ -24,12 +24,19 @@ if [ ! -d "$install_dir/dotnet" ]; then
ynh_safe_rm "/usr/bin/dotnet"
fi
if ynh_app_upgrading_from_version_before_or_equal_to 14.3.0~ynh1; then
mkdir -p "/var/log/$app"
mv "$data_dir/logs" "/var/log/$app/dns"
chown -R "$app:$app" "/var/log/$app"
ln -sf "/var/log/$app/dns" "$data_dir/logs"
ln -sf $(ls -t /var/log/$app/dns/*.log | head -n 1) /var/log/$app/$app.log
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --source_id="prebuilt" --dest_dir="$install_dir/sources" --full_replace
ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" --full_replace
@@ -38,22 +45,23 @@ ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" --full_re
#=================================================
ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated NGINX config
ynh_config_add_nginx
# Create a dedicated systemd config
ynh_config_add_systemd
yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports=53
yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53
# Use logrotate to manage app-specific logfile(s)
ynh_config_add_logrotate /var/log/technitium/dns
#=================================================
# ADD A CRON JOB
#=================================================
ynh_config_add --template="logsymlink.cron" --destination="/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console."
ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="was started successfully"
#=================================================
# END OF SCRIPT