Conversation
The previous script only printed messages. Per the FPP plugin guidelines, uninstall must reverse every side effect created outside the plugin directory and be safe to run repeatedly. It now: - stops the mqtt_listener.py process started in postStart.sh (FPP does not run preStop.sh on uninstall, so it would otherwise keep running) - removes the SQLite database plus its -journal/-wal/-shm sidecars and the plugin.<repoName>.db.backup-* copies left in config/ by the restore and empty-database actions - removes the plugin log file (both the current name and the plugin-<repoName>.log name) - removes the plugin settings file All removals use "rm -f" or are guarded, so re-running is safe. python3-paho-mqtt is left installed as a shared dependency. Refs OnlineDynamic#11 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pkill/pgrep -f "mqtt_listener.py" could in principle match an unrelated process of the same name. Scope the pattern to this plugin: - postStart.sh: use the absolute launch path ($MQTT_LISTENER) - preStop.sh / fpp_uninstall.sh: match "fpp-plugin-AdvancedStats/mqtt_listener.py" This does not touch FPP's built-in MQTT (compiled into fppd) or the mosquitto broker service - neither has mqtt_listener.py in its command line. Refs OnlineDynamic#11 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces
scripts/fpp_uninstall.sh(which only printed messages) with an idempotent cleanup that reverses the side effects this plugin creates outside its plugin directory, as required by the FPP plugin guidelines.Fixes #11.
fpp_uninstall.shnow doesmqtt_listener.py— it is started inpostStart.sh, but FPP does not runpreStop.shon uninstall, so it would otherwise keep running against a deleted script until the nextfppdstop/reboot.plugin.fpp-plugin-AdvancedStats.dbplus its-journal/-wal/-shmsidecars.plugin.fpp-plugin-AdvancedStats.db.backup-*copies left inconfig/by the restore and empty-database actions.fpp-plugin-AdvancedStats.logand the guideline-compliantplugin-fpp-plugin-AdvancedStats.logname).config/plugin.fpp-plugin-AdvancedStats.All removals use
rm -for are guarded, so the script is safe to run more than once.python3-paho-mqttis intentionally left installed as a shared dependency.Process match tightened (2nd commit)
pkill/pgrep -f "mqtt_listener.py"is scoped so it can only match this plugin's process:postStart.sh— matches the absolute launch path ($MQTT_LISTENER)preStop.sh/fpp_uninstall.sh— matchfpp-plugin-AdvancedStats/mqtt_listener.pyThis does not affect FPP's built-in MQTT (compiled into
fppd) or themosquittobroker service — neither hasmqtt_listener.pyin its command line.Out of scope
plugin-<repoName>.logpattern (so FPP rotates it) touches the Python and PHP writers — noted in fpp_uninstall.sh removes nothing; plugin data/log/DB and running listener left behind #11.config/toplugindata/.Testing
sh -npasses on all three scripts. Paths reviewed againstinit_database.php,api.php,functions.inc.php,mqtt_listener.py,callbacks.py, and thescripts/hooks.🤖 Generated with Claude Code