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

Fixes #709. Add Standard- and StandardError log configuration for SystemD #717

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

h0jeZvgoxFepBQ2C
Copy link

I've added options to configure the log entries for the systemd configuration.
I overwrote the export defaults in the SystemD class, to keep the behaviour of writing to syslog the same as before (before, syslog was called explicit in the systemd files directly) - so it should not break the default behaviour from before.

I also added 2 tests which pass fine.
Feel free to comment and merge, if everything is fine :)

Hope this PR is fine, it's my first one for this project :)

@h0jeZvgoxFepBQ2C
Copy link
Author

Looks like the travis check is failing due to other reasons, not this PR as far as I understand it? @ddollar

@h0jeZvgoxFepBQ2C
Copy link
Author

Do you know already when you have some time to give some feedback or merge it? @ddollar Thanks!

@ClikeX
Copy link

ClikeX commented Sep 12, 2018

Any update on this PR? As @lichtamberg said, the Travis build seems to have failed on something unrelated to the PR.

Can we perhaps rerun this PR on Travis?

@h0jeZvgoxFepBQ2C
Copy link
Author

h0jeZvgoxFepBQ2C commented Sep 12, 2018

Actually this PR is broken, since the official systemd standard uses

# file:/ is missing
StandardOut=file:/path/to/file

I didn't have time to change this and since only newer versions of systemd allow file logging (see systemd/systemd#7198) I cannot test it on my servers, since we have an older version installed. Will try to find some time to fix this and hope someone else can test it.

Also the CLI integration doesn't work completely, or at least I didn't manage it to work correctly - will also try to fix it.

@h0jeZvgoxFepBQ2C
Copy link
Author

Ok, I've fixed the CLI integration & file descriptor, added another test & updated documentation.
Would be nice if someone could test it, the Travis CI test fail is proably not related to my PR as others and me said already.

@jarthod
Copy link

jarthod commented Mar 2, 2020

I'm not sure we should add a new flag for error log files, as in other exports (ex supervisord) there's already the two files specified based on the log folder:

stdout_logfile=<%= log %>/<%= name %>-<%= num %>.log
stderr_logfile=<%= log %>/<%= name %>-<%= num %>.error.log

Source: https://github.com/ddollar/foreman/blob/master/data/export/supervisord/app.conf.erb

We should probably do the same for systemd? or add this option everywhere but that should be another MR IMO ;)

@jarthod
Copy link

jarthod commented Dec 7, 2022

For the record it looks like syslog (the only possible output at the moment) is being deprecated, I just saw this after upgrading to Ubuntu 22.04:

Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.

I have

> systemd --version
systemd 249 (249.11-0ubuntu3.6)

For the record, this is the customization I'm using now and it works fine with systemd v240+:

# custom part to use file logging instead of syslog
# "append" option only works with systemd v240+
# https://github.com/ddollar/foreman/pull/717
StandardOutput=append:<%= log %>/<%= name %>.log
StandardError=append:<%= log %>/<%= name %>.log

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.

None yet

3 participants