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

Unable to use Systemd module with tar distribution #3666

Closed
Ripolin opened this issue Jun 23, 2022 · 6 comments
Closed

Unable to use Systemd module with tar distribution #3666

Ripolin opened this issue Jun 23, 2022 · 6 comments

Comments

@Ripolin
Copy link
Contributor

Ripolin commented Jun 23, 2022

Why use of Systemd module is limited to RPM and DEB installations ?

To me there is no relationship between Sytemd and package managers and it could be possible to use Systemd module for installations using tar distribution.

final boolean isPackageDistribution = buildType == Build.Type.DEB || buildType == Build.Type.RPM;

@dblock
Copy link
Member

dblock commented Jun 23, 2022

@peterzhuamazon do you know anything about this?

@peterzhuamazon
Copy link
Member

Hi @Ripolin @dblock .

Sure, there is no limit saying you can only use systemd with deb/rpm.
However, deb/rpm have pre/post scripts and setup folder structure/configs specifically, so the corresponding systemd service scripts can execute without issues.

You can certainly write a service script yourself for things like tar, but that relies on you to setup rules for that script.
It is easy to tweak tarball extract locations and configuration / data folder / log folder directories and that is not suitable for systemd as it is asking for pre-defined setups.

The code here is just saying DEB/RPM is having packagedistro type, I see no issues with this setup tho.

Please let me know your thoughts.

Thanks.

@Ripolin
Copy link
Contributor Author

Ripolin commented Jun 29, 2022

Hi @peterzhuamazon and thx for your response

I exactly do what you say ;p

Indeed I create my own Systemd service of type "notify", init env var OPENSEARCH_SD_NOTIFY with true value and add systemd module in my installation (by default this module is not present in TAR distribution).

The problem is it only works after edit bin/opensearch-env file to modify OPENSEARCH_DISTRIBUTION_TYPE entry with value rpm

Refer to line :

and line :

TAR installation cannot notify Systemd to tell service is really up because isPackageDistribution and enabledvars are initialized with false value.

The only way to use Systemd with TAR distribution without hack opensearch-env file is to use a "simple" service and not a "notify" one. But using a simple service make systemd module useless and can creates issues when service starts because the system thinks service is fully up but it's not the case.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Jun 30, 2022

@Ripolin if you are talking about that notify thing, yeah that is only supported in DEB/RPM.
When I 1st create opensearch/dashboards rpm from tar I see the same issue.
My solution is just create the bundle rpm from core rpm instead of core tar.

If you think the above setup is not ideal, would you mind raise a PR to fix it? 😄
@dblock I have no concerns to allow notify available in tarball, but I dont know the historical reason why it is limited.
Any comments from you on this?

Thanks.

@Ripolin
Copy link
Contributor Author

Ripolin commented Jul 1, 2022

@peterzhuamazon OK I'll do a PR soon 👍

@dblock
Copy link
Member

dblock commented Jul 5, 2022

If you think the above setup is not ideal, would you mind raise a PR to fix it? 😄 @dblock I have no concerns to allow notify available in tarball, but I dont know the historical reason why it is limited. Any comments from you on this?

Neither do I :(

Ripolin added a commit to Ripolin/OpenSearch that referenced this issue Jul 13, 2022
Signed-off-by: Florent David <florent.david@gmail.com>
@dblock dblock closed this as completed in 2858eb1 Jul 14, 2022
opensearch-trigger-bot bot pushed a commit that referenced this issue Jul 14, 2022
* Fix #3666

Signed-off-by: Florent David <florent.david@gmail.com>

* Fix linter issues

Signed-off-by: Florent David <florent.david@gmail.com>

* Add systemd module in linux and freebsd archives

Signed-off-by: Florent David <florent.david@gmail.com>
(cherry picked from commit 2858eb1)
reta pushed a commit that referenced this issue Jul 14, 2022
* Fix #3666

Signed-off-by: Florent David <florent.david@gmail.com>

* Fix linter issues

Signed-off-by: Florent David <florent.david@gmail.com>

* Add systemd module in linux and freebsd archives

Signed-off-by: Florent David <florent.david@gmail.com>
(cherry picked from commit 2858eb1)

Co-authored-by: Ripolin <florent.david@gmail.com>
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

No branches or pull requests

3 participants