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

Add a systemd script (#50) #260

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Add a systemd script (#50) #260

merged 1 commit into from
Jan 19, 2024

Conversation

davidcoutadeur
Copy link
Contributor

Fixes #50

@davidcoutadeur davidcoutadeur added this to the 2.2 milestone Jan 8, 2024
@davidcoutadeur davidcoutadeur self-assigned this Jan 8, 2024
This was referenced Jan 8, 2024
@davidcoutadeur
Copy link
Contributor Author

davidcoutadeur commented Jan 8, 2024

This PR only takes care about adding the systemd files. Integration in debian / red-hat will be done elsewhere.

@davidcoutadeur
Copy link
Contributor Author

On more point to check in this PR: describe the way to duplicate the sync/async systemd script to have more than one task.
Possible leads:

  • overload systemd script (systemctl edit)
  • use systemd instances

We need to clarify this in documentation, and also define if admins should use /etc/default for LSC_CONFIG_DIR, LSC_SYNC_TASKS,...

@davidcoutadeur
Copy link
Contributor Author

On more point to check in this PR: describe the way to duplicate the sync/async systemd script to have more than one task. Possible leads:

* overload systemd script (systemctl edit)

* use systemd instances

We need to clarify this in documentation, and also define if admins should use /etc/default for LSC_CONFIG_DIR, LSC_SYNC_TASKS,...

We can only pass one parameter to a systemd instance.

But admins can still use systemd instances for defining the path to /etc/default/lsc to load.

@davidcoutadeur
Copy link
Contributor Author

I have provided an example of systemd instance in 527a318

Not tested yet, but it should do the job. @xavierba if you have any remark? @coudot don't hesistate if you have an opinion on this topic.

@davidcoutadeur
Copy link
Contributor Author

As pointed out by @xavierba , we should take advantage of this issue to drop the support of init.d.
I am favourable for doing so, because systemd is now the default component:

  • since centos 7
  • since debian 8

Anyway, we no longer support lsc packages for OS older that these.

If everyone is ok with that, I am going to remove init.d in #260

@davidcoutadeur
Copy link
Contributor Author

systemd scripts seems ready in #260
I am going to merge.

What I have done since last review:

  • removed /etc/init.d/lsc support
  • removed useless sed on /etc/default/lsc-* files (since these variables are now defined in corresponding systemd unit files)
  • fix pid filename directly in systemd unit file
  • removed %systemd_preun [email protected] since systemd doesn't know which instance to stop (even with a joker)
  • removed /etc/default/lsc (since not used any more)
  • clean and simplify /etc/default/lsc-sync and /etc/default/lsc-async
  • write the documentation (see https://github.com/lsc-project/documentation/blob/main/source/run.rst#using-systemd-service)
  • test build + install + run + remove on debian12: OK
  • test build + install +run + remove on rocky9: OK (warnings during preinstall, but not due to systemd)
  • split long lines

@davidcoutadeur davidcoutadeur merged commit 6b0b6b9 into master Jan 19, 2024
1 check passed
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.

Make a systemd script
2 participants