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

StateDirectory not available on Amazon Linux 2 #419

Open
deepy opened this issue Sep 26, 2022 · 10 comments
Open

StateDirectory not available on Amazon Linux 2 #419

deepy opened this issue Sep 26, 2022 · 10 comments

Comments

@deepy
Copy link

deepy commented Sep 26, 2022

The packaged systemd service includes StateDirectory which doesn't seem to exist on Amazon Linux 2

[/usr/lib/systemd/system/logdna-agent.service:12] Unknown lvalue 'StateDirectory' in section 'Service'
@dkhokhlov
Copy link
Contributor

file in repo does not have it:
https://github.com/logdna/logdna-agent-v2/blob/master/linux/logdna-agent.service#L12
agent version?

@deepy
Copy link
Author

deepy commented Sep 26, 2022

I'm getting this with both 3.6.0-1 and 3.5.2-1

@deepy
Copy link
Author

deepy commented Sep 26, 2022

There is however a file in the repo which does have it, and it's in packaging
https://github.com/logdna/logdna-agent-v2/blob/master/packaging/linux/logdna-agent.service#L12

@dkhokhlov
Copy link
Contributor

dkhokhlov commented Sep 26, 2022

ic. your systemd version?
systemd --version

@deepy
Copy link
Author

deepy commented Sep 26, 2022

219

@dkhokhlov
Copy link
Contributor

dkhokhlov commented Sep 26, 2022

too old - 2015. that StateDirectory is needed for non-root service when /var/lib/logdna has to be created by systemd.
will look into this. thanks.

@dkhokhlov
Copy link
Contributor

Update:

  • Amazon Linux 2 uses old version of systemd which does not support StateDirectory option in service configuration.
  • StateDirectory tells systemd to create “/var/lib/logdna" with proper permissions
  • StateDirectory line in “logdna-agent.service” file needs to be commented out on Amazon Linux 2.
    if you want to run agent using non-root user then you need to create “/var/lib/logdna" directory manually and assign proper permissions for that user. agent needs read-write access to that folder.

@TJDev
Copy link

TJDev commented Nov 4, 2022

@dkhokhlov Does this mean that we cannot use the latest version with AWS instances installing over yum? The info for Elastic Beanstalk would then also be not working?

@deepy
Copy link
Author

deepy commented Nov 4, 2022

@TJDev if you install the package on Amazon Linux you need to manually modify the package-provided systemd service to be able to start it

@TJDev
Copy link

TJDev commented May 10, 2023

I have created a gist based on the former one for old logdna-agent with the requirements for AL2 (create directory, remove StateDirectory). Work in a test environment for me.

https://gist.github.com/TJDev/df2262535895190599ff96d43a28c329

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