Permalink
Browse files

ossec doesnt have rc script for arch but now we do :)

  • Loading branch information...
1 parent 8b2921e commit 00ec9ee063c606e9e8b959b423ab888f133f6596 @jtimberman jtimberman committed Dec 29, 2010
Showing with 75 additions and 2 deletions.
  1. +19 −1 ossec/metadata.json
  2. +5 −1 ossec/metadata.rb
  3. +9 −0 ossec/recipes/default.rb
  4. +42 −0 ossec/templates/arch/ossec.rc.erb
View
@@ -6,6 +6,24 @@
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
"platforms": {
+ "debian": [
+
+ ],
+ "ubuntu": [
+
+ ],
+ "arch": [
+
+ ],
+ "redhat": [
+
+ ],
+ "centos": [
+
+ ],
+ "fedora": [
+
+ ]
},
"dependencies": {
"build-essential": [
@@ -28,5 +46,5 @@
},
"recipes": {
},
- "version": "1.0.0"
+ "version": "1.0.1"
}
View
@@ -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
View
@@ -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]
@@ -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.