Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrading sets /etc/systemd/system/sshnpd.service back to template so reconfiguration required #1567

Open
gkc opened this issue Nov 25, 2024 · 4 comments · May be fixed by #1596
Open

upgrading sets /etc/systemd/system/sshnpd.service back to template so reconfiguration required #1567

gkc opened this issue Nov 25, 2024 · 4 comments · May be fixed by #1596
Assignees
Labels
bug Something isn't working

Comments

@gkc
Copy link
Contributor

gkc commented Nov 25, 2024

Describe the bug

Report from customer:

Doc says to follow the install instructions e.g. run install.sh. The end result was /etc/systemd/system/sshnpd.service was set back to the template so had to be reconfigure it. Unless I missed something it would be much better if when upgrading it could leave the previously configured file or at a min copy the existing one?

Steps to reproduce

  • Install v5.6.1 on a Linux system choosing systemd as the run mechanism. Update sshnpd.service to be the way you want it
  • Upgrade the installation to v5.7.0
  • sshnpd.service has reverted to template

Expected behavior

  • If sshnpd.service already exists then it should not be updated

Screenshots

No response

Smartphones

No response

Were you using an atApplication when the bug was found?

No response

Additional context

No response

@gkc gkc added the bug Something isn't working label Nov 25, 2024
@cpswan cpswan self-assigned this Nov 25, 2024
@cpswan
Copy link
Member

cpswan commented Nov 28, 2024

Having taken an initial look at this...

  • The docs shouldn't be referencing install.sh as that's now wrapped by universal.sh
  • universal.sh would still create a new unit file, but it would also fill in the required variables (but might well overwrite any custom config)
  • Since universal.sh does this by calling install.sh which copies the template in place we might be better off having a check for the existing unit file and skipping if it's there
    • and maybe an option to force a new unit file to get a clean state

@XavierChanth I'm starting to feel like the interaction between universal.sh and install.sh is getting unwieldy (and that it was never really intended for upgrading)

Looking down the road to things like EU Cyber Resilience Act (CRA) we're going to need an automated update mechanism, so we should start thinking now what we'd like that to look like.

@XavierChanth
Copy link
Member

Okay, going forward we should probably use the EnvironmentFile directive in systemd as a config file.

This will make it easier on us to just wipe the systemd file if we ever need to make changes. With a standard format for an environment file, we can append new variables to it without having to wipe any existing config.

@cpswan
Copy link
Member

cpswan commented Dec 5, 2024

Finding How to set environment variable in systemd service?, and after some discussion in arch call I tried:

  • EnvironmentFile - this felt very much like a mechanism to deal with the old world of SysV init scripts residing in /etc/sysconfig
  • override.conf - this felt much more like the systemd native way of doing things, especially as it makes use of systemctl edit

@cpswan cpswan linked a pull request Dec 5, 2024 that will close this issue
@cpswan
Copy link
Member

cpswan commented Dec 9, 2024

Some progress in PR101, but scope has widened so continuing into PR102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants