Write the Signal K launcher wrapper on every update - #7
Open
mark-brannan wants to merge 1 commit into
Open
Conversation
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.
Fixes #6.
~/.signalk/signalk-serveris written with the npm prefix resolved at that moment, inside thesettings.jsoncheck, so it is written once on a first install and never again. When the npm prefix changes later, updates install a new signalk-server under the new prefix while the wrapper keeps starting the old copy. The update reports success and the running server does not change.The check is there to protect user config, and that is right. The wrapper is not user config. It is built entirely from the prefix and
skDir, so it can be written again on every run without losing anything. This moves the wrapper generation, and thechownandchmodthat belong with it, out of the check.Nothing else changes.
package.json,security.jsonandsettings.jsonstay inside the check as before.Testing
Same Docker setup as in #6, run twice: once with the packaged script and once with this patch layered over it. Only the script differs.
I have not tested this on Raspberry Pi OS. My own Pi is a boat in use and I could not take it down. The container covers Debian bookworm with the real packages from the OpenPlotter repository, but not systemd or the GUI, so a check on real hardware before release would be worth doing.
I did not touch
debian/changelogorversion.py, since those look like release-time changes you make yourself.Item 3 in #6 is a one-line change in the same function (
os.mkdirfails when the directory exists withoutsettings.json). I left it out to keep this to one change. Glad to send it separately.I used an AI assistant to investigate this and to draft the reproduction. The container in #6 is there so you do not have to take any of it on trust.