Skip to content

Commit

Permalink
Add systemd support
Browse files Browse the repository at this point in the history
[delivers #110502712]
  • Loading branch information
dividedmind committed Dec 21, 2015
1 parent 24cd84a commit 43e1002
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions files/default/systemd/logshipper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Conjur log shipping service
Documentation=https://developer.conjur.net
RequiresOverridable=rsyslog.service

[Service]
ExecStart=/usr/sbin/logshipper -n /var/run/logshipper
Restart=always
User=logshipper
Group=conjur

[Install]
WantedBy=rsyslog.target
2 changes: 2 additions & 0 deletions libraries/conjur_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module ConjurDetect
def self.detect_init
if test 'x', '/sbin/runit'
'runit'
elsif test 'x', '/usr/bin/systemctl'
'systemd'
else
'upstart'
end
Expand Down
13 changes: 13 additions & 0 deletions recipes/_install_logshipper_systemd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cookbook_file '/etc/systemd/system/logshipper.service' do
source 'systemd/logshipper.service'
owner 'root'
group 'root'
mode '0755'
end

bash 'enable and run logshipper' do
code """
systemctl enable logshipper
systemctl start logshipper
"""
end

0 comments on commit 43e1002

Please sign in to comment.