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

Use a named pipe for logging in upstart example #2046

Merged
merged 2 commits into from Nov 11, 2014

Conversation

sorentwo
Copy link
Contributor

The ability to log directly to /dev/kmsg was removed in Ubuntu 14.04, making the existing example config fail to perform any real logging. Appending a pipe to the last exec within the script block gives upstart an incorrect PID to work with, which can lead to various issues.

This uses a FIFO solution that logs to syslog at any permission level and doesn't leave anything on the file system afterwards.

The ability to log directly to /dev/kmsg was removed in Ubuntu 14.04,
making the existing example config fail to perform any real logging.
Appending a pipe to the last `exec` within the `script` block gives
upstart an incorrect PID to work with, which can lead to various issues.

This uses a FIFO solution that logs to syslog at any permission level
and doesn't leave anything on the file system afterwards.
@mperham
Copy link
Collaborator

mperham commented Nov 10, 2014

I'd suggest an alternative: punt on the problem, log to stdout and have the output go to /var/log/upstart/<servicename>.log. wdyt?

@sorentwo
Copy link
Contributor Author

I was under the impression that sidekiq 3.0+ was favoring user jobs, which have the caveat that they can't log to /var/log/upstart/<servicename>log. From the cookbook:

User jobs cannot currently take advantage of job logging. If a user job does specify console log, it is considered to have specified console none. Logging of user jobs is planned for the next release of Upstart.

I'm fine with punting on the default config entirely. I only suggest that:

  1. Remove the exec &> /dev/kmsg as it fails in recent Ubuntu's
  2. Keep some documentation about how to actually achieve system logging with a user job via the fifo/logger trick. There may be a place for that in the wiki, but I haven't dug into it.

@mperham
Copy link
Collaborator

mperham commented Nov 10, 2014

I definitely don't recommend user jobs (e.g. /home/bob/.upstart) for normal users. Where did you get that idea? Sidekiq isn't typically used in a shared Linux system but rather run as a system service on a machine dedicated to running a business app (e.g. a Rails app).

Sounds great.

@sorentwo
Copy link
Contributor Author

I was referencing #1532, which referenced User Jobs. Anyhow, I'll modify the PR to simply remove logging and note the default log path.

Simply notes the default log location and synchronizes the one and many
example configs.
@sorentwo
Copy link
Contributor Author

@mperham: Pushed that change. Purely documentation and synching the two examples now.

mperham added a commit that referenced this pull request Nov 11, 2014
Use a named pipe for logging in upstart example
@mperham mperham merged commit 76f8d7e into sidekiq:master Nov 11, 2014
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

2 participants