Skip to content

Commit

Permalink
ossec doesnt have rc script for arch but now we do :)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Dec 29, 2010
1 parent 8b2921e commit 00ec9ee
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
20 changes: 19 additions & 1 deletion ossec/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
"platforms": {
"debian": [

],
"ubuntu": [

],
"arch": [

],
"redhat": [

],
"centos": [

],
"fedora": [

]
},
"dependencies": {
"build-essential": [
Expand All @@ -28,5 +46,5 @@
},
"recipes": {
},
"version": "1.0.0"
"version": "1.0.1"
}
6 changes: 5 additions & 1 deletion ossec/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
license "Apache 2.0"
description "Installs/Configures ossec"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
version "1.0.1"

depends "build-essential"

%w{ debian ubuntu arch redhat centos fedora }.each do |os|
supports os
end
9 changes: 9 additions & 0 deletions ossec/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@
notifies :restart, "service[ossec]"
end

case node['platform']
when "arch"
template "/etc/rc.d/ossec" do
source "ossec.rc.erb"
owner "root"
mode 0755
end
end

service "ossec" do
supports :status => true, :restart => true
action [:enable, :start]
Expand Down
42 changes: 42 additions & 0 deletions ossec/templates/arch/ossec.rc.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh
# OSSEC Controls OSSEC HIDS
# Author: Daniel B. Cid <dcid@ossec.net>
# Modified for ArchLinux by Joshua Timberman <joshua@opscode.com>

. /etc/ossec-init.conf
if [ "X${DIRECTORY}" = "X" ]; then
DIRECTORY="<%= node['ossec']['user']['dir'] %>"
fi


start() {
${DIRECTORY}/bin/ossec-control start
}

stop() {
${DIRECTORY}/bin/ossec-control stop
}

status() {
${DIRECTORY}/bin/ossec-control status
}


case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "usage: $0 {start|stop|restart|status}"
exit 1
esac

0 comments on commit 00ec9ee

Please sign in to comment.