fiskaltrust / middleware-launcher

The Middleware Launcher is used to host fiskaltrust's Middleware for POS systems on desktop operating systems like Windows, Linux and macOS.
https://docs.fiskaltrust.cloud
European Union Public License 1.2
2 stars 1 forks source link

Error installing launcher twice #139

Closed LeilaZarban closed 9 months ago

LeilaZarban commented 10 months ago

Background

When a user on linux installs the launcher 2 times (sudo ./fiskaltrust.Launcher install), they get the following error.

Image

Problem

When writing to the systemd unit file /etc/systemd/system/*.service we append. This leads to the file being invalid.

Solution

We should not append to the systemd unit file but overwrite it.

Before installing the launcher service we should check if the launcher is already installed (by checking if the file exists and by using systemd) and fail the installation in this case with nice error messages (in the error message we can tell them to run the uninstall command, if that actually solves the problem).

In the uninstall command we should make sure that we actually remove the file and that that is enough to really remove the service from systemd.

forsthug commented 10 months ago

The systemd service is never fully running at the moment, it suddenly stops. It seems the lifetime solution is not working. Maybe we should consider this implementation https://devblogs.microsoft.com/dotnet/net-core-and-systemd/