systemd-journal 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.github/workflows/ruby.yml +17 -0
- data/.gitignore +1 -0
- data/README.md +12 -2
- data/certs/john@throttle.io.pem +23 -19
- data/lib/systemd/journal/version.rb +1 -1
- data/lib/systemd/journal/writable.rb +1 -1
- data/spec/systemd/journal_spec.rb +12 -2
- data/systemd-journal.gemspec +2 -2
- metadata +32 -31
- metadata.gz.sig +0 -0
- data/Dockerfile.bionic +0 -19
- data/Dockerfile.centos +0 -11
- data/Dockerfile.xenial +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dba31ecf5a267f987bbb2f8986c9c73039a9b6baf51803a717cc5658fdfcee96
|
4
|
+
data.tar.gz: bac252ca548a5d09d316f8445b0f17e5307e9ccf5a41beb0443e3dabc8495ab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f31a764d3f64ead90e25b3956778c5c563bd4133c994e76920fb3702b889c8d0042205e99e8be8d6c9884dc70ea29cb4429299239014d406344318547bff80
|
7
|
+
data.tar.gz: ab946f8aaa1555591828571bb31ea2861d0dace3a32f1f97fe50af981901e993cf030667d637c4e47ed64a05dbfe57939f3673eb32e7e2ea074aeb2a6e264267
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: RSpec Matrix
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
os: [ubuntu]
|
9
|
+
ruby: [2.5, 2.6, 2.7, jruby]
|
10
|
+
runs-on: ${{ matrix.os }}-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: ${{ matrix.ruby }}
|
16
|
+
- run: bundle install
|
17
|
+
- run: bundle exec rake spec
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Systemd::Journal [![Gem Version](https://badge.fury.io/rb/systemd-journal.png)](http://badge.fury.io/rb/systemd-journal)
|
1
|
+
# Systemd::Journal [![Gem Version](https://badge.fury.io/rb/systemd-journal.png)](http://badge.fury.io/rb/systemd-journal) [![Code Climate](https://codeclimate.com/github/ledbettj/systemd-journal.png)](https://codeclimate.com/github/ledbettj/systemd-journal)
|
2
2
|
|
3
3
|
Ruby bindings for reading from the systemd journal.
|
4
4
|
|
@@ -10,7 +10,7 @@ Ruby bindings for reading from the systemd journal.
|
|
10
10
|
Add this line to your application's Gemfile:
|
11
11
|
|
12
12
|
```ruby
|
13
|
-
gem 'systemd-journal', '~> 1.
|
13
|
+
gem 'systemd-journal', '~> 1.4'
|
14
14
|
```
|
15
15
|
|
16
16
|
And then execute:
|
@@ -151,6 +151,14 @@ The solution is to always call one of `move`, `move_next`, `move_previous` and
|
|
151
151
|
friends before reading after issuing one of the above calls. For most functions,
|
152
152
|
call `move_next`. For `seek(:tail)`, call `move_previous`.
|
153
153
|
|
154
|
+
### I get a segfault pointing at Native.sd_journal_get_fd
|
155
|
+
|
156
|
+
This is caused by a bug in libsystemd v245 (and maybe earlier) which cannot be
|
157
|
+
solved in this gem, sadly. It's fixed upstream in [this commit](https://github.com/systemd/systemd/commit/2b6df46d21abe8a8b7481e420588a9a129699cf9), which you can ask your distribution to backport if
|
158
|
+
necessary until v246 is released.
|
159
|
+
|
160
|
+
In ArchLinux, this patch is applied in systemd-libs 245.6-2.
|
161
|
+
|
154
162
|
## Issues?
|
155
163
|
|
156
164
|
This gem has been tested primarily on MRI and Arch Linux running systemd version
|
@@ -160,6 +168,8 @@ distributions.
|
|
160
168
|
The gem will run under JRuby, although some features which rely on native file
|
161
169
|
descriptor support will not work.
|
162
170
|
|
171
|
+
The gem will not run under truffleruby due to missing support for some FFI features.
|
172
|
+
|
163
173
|
If you run into problems or have questions, please open an
|
164
174
|
[Issue](https://github.com/ledbettj/systemd-journal/issues) or Pull Request.
|
165
175
|
|
data/certs/john@throttle.io.pem
CHANGED
@@ -1,21 +1,25 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
2
|
+
MIIEMDCCApigAwIBAgIBATANBgkqhkiG9w0BAQsFADAhMR8wHQYDVQQDDBZqb2hu
|
3
|
+
L0RDPXRocm90dGxlL0RDPWlvMB4XDTIwMDczMDIyMTUxNVoXDTIxMDczMDIyMTUx
|
4
|
+
NVowITEfMB0GA1UEAwwWam9obi9EQz10aHJvdHRsZS9EQz1pbzCCAaIwDQYJKoZI
|
5
|
+
hvcNAQEBBQADggGPADCCAYoCggGBAMEZjnWtA5/YsYEDvWlTAPOP2NshfBVcNSXE
|
6
|
+
FHg4refJstCaf59iqFEWbEjLmbezK6HA5vzM6ZenEom2S1Rzj0OButABHKaISjxE
|
7
|
+
wJG/DZ8fJTx+Yn970cIA7jH0r03/kpg8fzrCWjUH+Jy3vX8dkTa0I+fWz45k9o1g
|
8
|
+
e+ENGeIRklG7T8rNCmJP6oacGJUfdmXSHDszg0u1dCi4scth1vksDbZwyL/BPqGF
|
9
|
+
hLvIeAXwm1TPXKvD13odTRBgHj5h7w7YOBmcqGwq+rgEC+iRJhdS00x+mquD9Gdm
|
10
|
+
CjCvRnS7JG4UTpmUxsdY0snPCiHZjbjCKhZr+dciOOWLQE2NVuTeiyNg5di7XMq+
|
11
|
+
blIh6acnMZThiR8+bHAprJ1P+DtZ6uY0oePnRZ2K1pebGIOjA/UKaHlvbatyB49z
|
12
|
+
NdTvAWRWAQ2tSOpQhtR/3Pp6SYniT+/lnsW3H4bBsY14wEfPp8tkp7SdbyjoEeaz
|
13
|
+
ljX4Qi8q0ozKO22jbtwzE6F9V/EzzwIDAQABo3MwcTAJBgNVHRMEAjAAMAsGA1Ud
|
14
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUVLZVCCB2lbddzYxAxk/g4bfBjhQwGwYDVR0RBBQw
|
15
|
+
EoEQam9obkB0aHJvdHRsZS5pbzAbBgNVHRIEFDASgRBqb2huQHRocm90dGxlLmlv
|
16
|
+
MA0GCSqGSIb3DQEBCwUAA4IBgQAxwbDSdDZjJQ4pKoV1Xf5kj9JKL1GvJ8jotTyx
|
17
|
+
Oy8BXUV+iiYXCelwfvBIsBtz64pH1VVg4/xrv2Vsi3It3IUdlbxUHi5Bn0X0W9ci
|
18
|
+
xkQYlszu4au+oz86MY/LMx83r9y+3GKy633JH5qmILotKHgzAcoFK5mASC9QyJWV
|
19
|
+
EK5FWtQGVJUelB4K3P93pxICfN5os04TCW4lAzLEwYwc+TVGDa1q1u8Wr7haId4o
|
20
|
+
fsQvapSzlO/jXwtepH363FhrdqYnXJ1acyCGBtaHzOcRUTmgRtTwNoMQICwNzeJ+
|
21
|
+
VvAOtMDRJT68kz5nD1G6AyriHzLptEt2/+Oq/DmAY3E2q+qN7Rb3THDBDFV7u3Cw
|
22
|
+
aNcGx7j1YvV5morU/wytvIA1XvjZlp27MBu0dd4kL8k7SRApTxnRjavsDrz1Oxa6
|
23
|
+
BTJGZ4qddTGCNj/QRwzZegXpckYB3u60wiU6EECWndotUYuKbgObSDU4Nh1cdrzw
|
24
|
+
FIew3kKXPiBpZBN3eDxal56e+R0=
|
21
25
|
-----END CERTIFICATE-----
|
@@ -66,7 +66,7 @@ module Systemd
|
|
66
66
|
# severity of the event.
|
67
67
|
# @param [String] message the content of the message to write.
|
68
68
|
def print(level, message)
|
69
|
-
rc = Native.sd_journal_print(level, message)
|
69
|
+
rc = Native.sd_journal_print(level, message.to_s.gsub('%', '%%'))
|
70
70
|
raise JournalError, rc if rc < 0
|
71
71
|
end
|
72
72
|
|
@@ -13,7 +13,7 @@ RSpec.describe Systemd::Journal do
|
|
13
13
|
expect(Systemd::Journal::Native).to receive(:sd_journal_close)
|
14
14
|
.and_call_original
|
15
15
|
|
16
|
-
result =
|
16
|
+
result = Systemd::Journal.open { 1 }
|
17
17
|
expect(result).to eq 1
|
18
18
|
end
|
19
19
|
|
@@ -21,7 +21,7 @@ RSpec.describe Systemd::Journal do
|
|
21
21
|
expect(Systemd::Journal::Native).to_not receive(:sd_journal_close)
|
22
22
|
|
23
23
|
expect do
|
24
|
-
|
24
|
+
Systemd::Journal.open(file: 1, path: 2, files: 3) { 1 }
|
25
25
|
end.to raise_error(ArgumentError)
|
26
26
|
end
|
27
27
|
end
|
@@ -438,4 +438,14 @@ RSpec.describe Systemd::Journal do
|
|
438
438
|
Systemd::Journal.message(message: 'hello % world %')
|
439
439
|
end
|
440
440
|
end
|
441
|
+
|
442
|
+
describe 'print' do
|
443
|
+
it 'escapes percent signs' do
|
444
|
+
expect(Systemd::Journal::Native).to receive(:sd_journal_print)
|
445
|
+
.with(Systemd::Journal::LOG_DEBUG, 'hello %% world %%')
|
446
|
+
.and_return(0)
|
447
|
+
|
448
|
+
Systemd::Journal.print(Systemd::Journal::LOG_DEBUG, 'hello % world %')
|
449
|
+
end
|
450
|
+
end
|
441
451
|
end
|
data/systemd-journal.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.summary = 'Ruby bindings to libsystemd-journal'
|
14
14
|
gem.homepage = 'https://github.com/ledbettj/systemd-journal'
|
15
15
|
|
16
|
-
gem.cert_chain = Dir['certs
|
16
|
+
gem.cert_chain = Dir['certs/john@throttle.io.pem']
|
17
17
|
|
18
18
|
if $PROGRAM_NAME.end_with?('gem')
|
19
19
|
gem.signing_key = ENV['GEM_SIGNING_KEY']
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |gem|
|
|
32
32
|
gem.add_development_dependency 'rspec', '~> 3.4'
|
33
33
|
gem.add_development_dependency 'simplecov', '~> 0.9'
|
34
34
|
gem.add_development_dependency 'rubocop', '~> 0.26' unless ENV['RUBOCOP'] == 'false'
|
35
|
-
gem.add_development_dependency 'rake', '~>
|
35
|
+
gem.add_development_dependency 'rake', '~> 12.3'
|
36
36
|
gem.add_development_dependency 'yard', '~> 0.9'
|
37
37
|
gem.add_development_dependency 'pry', '~> 0.10'
|
38
38
|
end
|
metadata
CHANGED
@@ -1,37 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: systemd-journal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Ledbetter
|
8
8
|
- Daniel Mack
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
14
|
+
MIIEMDCCApigAwIBAgIBATANBgkqhkiG9w0BAQsFADAhMR8wHQYDVQQDDBZqb2hu
|
15
|
+
L0RDPXRocm90dGxlL0RDPWlvMB4XDTIwMDczMDIyMTUxNVoXDTIxMDczMDIyMTUx
|
16
|
+
NVowITEfMB0GA1UEAwwWam9obi9EQz10aHJvdHRsZS9EQz1pbzCCAaIwDQYJKoZI
|
17
|
+
hvcNAQEBBQADggGPADCCAYoCggGB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apSzlO/jXwtepH363FhrdqYnXJ1acyCGBtaHzOcRUTmgRtTwNoMQICwNzeJ+
|
33
|
+
VvAOtMDRJT68kz5nD1G6AyriHzLptEt2/+Oq/DmAY3E2q+qN7Rb3THDBDFV7u3Cw
|
34
|
+
aNcGx7j1YvV5morU/wytvIA1XvjZlp27MBu0dd4kL8k7SRApTxnRjavsDrz1Oxa6
|
35
|
+
BTJGZ4qddTGCNj/QRwzZegXpckYB3u60wiU6EECWndotUYuKbgObSDU4Nh1cdrzw
|
36
|
+
FIew3kKXPiBpZBN3eDxal56e+R0=
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: ffi
|
@@ -95,14 +99,14 @@ dependencies:
|
|
95
99
|
requirements:
|
96
100
|
- - "~>"
|
97
101
|
- !ruby/object:Gem::Version
|
98
|
-
version: '
|
102
|
+
version: '12.3'
|
99
103
|
type: :development
|
100
104
|
prerelease: false
|
101
105
|
version_requirements: !ruby/object:Gem::Requirement
|
102
106
|
requirements:
|
103
107
|
- - "~>"
|
104
108
|
- !ruby/object:Gem::Version
|
105
|
-
version: '
|
109
|
+
version: '12.3'
|
106
110
|
- !ruby/object:Gem::Dependency
|
107
111
|
name: yard
|
108
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,12 +143,10 @@ executables: []
|
|
139
143
|
extensions: []
|
140
144
|
extra_rdoc_files: []
|
141
145
|
files:
|
146
|
+
- ".github/workflows/ruby.yml"
|
142
147
|
- ".gitignore"
|
143
148
|
- ".rubocop.yml"
|
144
149
|
- ".travis.yml"
|
145
|
-
- Dockerfile.bionic
|
146
|
-
- Dockerfile.centos
|
147
|
-
- Dockerfile.xenial
|
148
150
|
- Gemfile
|
149
151
|
- LICENSE.txt
|
150
152
|
- README.md
|
@@ -179,7 +181,7 @@ homepage: https://github.com/ledbettj/systemd-journal
|
|
179
181
|
licenses:
|
180
182
|
- MIT
|
181
183
|
metadata: {}
|
182
|
-
post_install_message:
|
184
|
+
post_install_message:
|
183
185
|
rdoc_options: []
|
184
186
|
require_paths:
|
185
187
|
- lib
|
@@ -194,9 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
196
|
- !ruby/object:Gem::Version
|
195
197
|
version: '0'
|
196
198
|
requirements: []
|
197
|
-
|
198
|
-
|
199
|
-
signing_key:
|
199
|
+
rubygems_version: 3.1.4
|
200
|
+
signing_key:
|
200
201
|
specification_version: 4
|
201
202
|
summary: Ruby bindings to libsystemd-journal
|
202
203
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|
data/Dockerfile.bionic
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
FROM ubuntu:18.04
|
2
|
-
|
3
|
-
RUN apt-get update -q && apt-get install -qy --no-install-recommends \
|
4
|
-
build-essential \
|
5
|
-
ruby \
|
6
|
-
ruby-bundler \
|
7
|
-
ruby-dev \
|
8
|
-
libsystemd0 \
|
9
|
-
git \
|
10
|
-
&& apt-get clean \
|
11
|
-
&& rm -rf /var/lib/apt/lists/* \
|
12
|
-
&& truncate -s 0 /var/log/*log
|
13
|
-
|
14
|
-
WORKDIR /usr/src
|
15
|
-
|
16
|
-
COPY . .
|
17
|
-
RUN bundle install
|
18
|
-
RUN cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32 | awk '{ print $1 }' | tee /etc/machine-id
|
19
|
-
RUN bundle exec rake
|
data/Dockerfile.centos
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
FROM centos:7
|
2
|
-
|
3
|
-
RUN yum install -y make gcc-c++ systemd ruby ruby-devel rubygem-bundler git
|
4
|
-
|
5
|
-
WORKDIR /usr/src
|
6
|
-
ENV RUBOCOP=false
|
7
|
-
|
8
|
-
COPY . .
|
9
|
-
RUN bundle install
|
10
|
-
RUN cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32 | awk '{ print $1 }' | tee /etc/machine-id
|
11
|
-
RUN bundle exec rake
|
data/Dockerfile.xenial
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
FROM ubuntu:16.04
|
2
|
-
|
3
|
-
RUN apt-get update -q && apt-get install -qy --no-install-recommends \
|
4
|
-
build-essential \
|
5
|
-
ruby \
|
6
|
-
ruby-bundler \
|
7
|
-
ruby-dev \
|
8
|
-
libsystemd0 \
|
9
|
-
git \
|
10
|
-
&& apt-get clean \
|
11
|
-
&& rm -rf /var/lib/apt/lists/* \
|
12
|
-
&& truncate -s 0 /var/log/*log
|
13
|
-
|
14
|
-
WORKDIR /usr/src
|
15
|
-
|
16
|
-
COPY . .
|
17
|
-
RUN bundle install
|
18
|
-
RUN cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32 | awk '{ print $1 }' | tee /etc/machine-id
|
19
|
-
RUN bundle exec rake
|