Skip to content

Write the Signal K launcher wrapper on every update - #7

Open
mark-brannan wants to merge 1 commit into
openplotter:masterfrom
mark-brannan:wrapper-on-every-update
Open

Write the Signal K launcher wrapper on every update#7
mark-brannan wants to merge 1 commit into
openplotter:masterfrom
mark-brannan:wrapper-on-every-update

Conversation

@mark-brannan

Copy link
Copy Markdown

Fixes #6.

~/.signalk/signalk-server is written with the npm prefix resolved at that moment, inside the settings.json check, 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 the chown and chmod that belong with it, out of the check.

Nothing else changes. package.json, security.json and settings.json stay 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.

before   RUN 2 wrapper -> /usr/lib/node_modules/...        (2.14.4, the old copy)
after    RUN 2 wrapper -> /usr/local/lib/node_modules/...  (2.30.0, what was just installed)

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/changelog or version.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.mkdir fails when the directory exists without settings.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signal K updates do not change the running server when the npm prefix changes

1 participant